DeveloperBreeze

Get Current URL

$currentUrl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
echo $currentUrl;

Related Posts

More content you might like

Tutorial
bash

How to Install and Configure Apache on Ubuntu

sudo tail -f /var/log/apache2/error.log

Congratulations! You have successfully installed and configured Apache on your Ubuntu server. You can now host your websites and further customize your Apache setup according to your needs.

Oct 21, 2024
Read More
Tutorial
bash

How to Create SSL for a Website on Ubuntu

Save the file and restart Nginx:

sudo systemctl restart nginx

Oct 21, 2024
Read More
Article
bash

Top 25 Nginx Web Server Best Security Practices

Use the limit_req module to throttle the rate of requests from clients, reducing the risk of DoS attacks.

limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
limit_req zone=one burst=5;

Sep 24, 2024
Read More
Tutorial
json bash

Building Progressive Web Apps (PWAs) with Modern APIs

Service Workers are scripts that run in the background, separate from the web page, enabling features like offline access and push notifications.

touch service-worker.js

Aug 05, 2024
Read More

Discussion 0

Please sign in to join the discussion.

No comments yet. Be the first to share your thoughts!