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

To verify if Apache is installed and running correctly, open your browser and enter your server’s IP address:

http://your-server-ip

Oct 21, 2024
Read More
Tutorial
bash

How to Create SSL for a Website on Ubuntu

sudo certbot --nginx

You’ll be prompted to:

Oct 21, 2024
Read More
Article
bash

Top 25 Nginx Web Server Best Security Practices

proxy_buffering off;

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

Sep 24, 2024
Read More
Tutorial
json bash

Building Progressive Web Apps (PWAs) with Modern APIs

mkdir my-pwa
cd my-pwa

Create the basic file structure:

Aug 05, 2024
Read More

Discussion 0

Please sign in to join the discussion.

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