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

  • Access logs: /var/log/apache2/access.log
  • Error logs: /var/log/apache2/error.log

You can view the logs using the cat or tail command:

Oct 21, 2024
Read More
Tutorial
bash

How to Create SSL for a Website on Ubuntu

If there are no errors, Certbot is successfully configured to automatically renew your certificates before they expire.

If you want to ensure the strongest security for your SSL configuration, you can edit your Nginx configuration file. Open it with a text editor:

Oct 21, 2024
Read More
Article
bash

Top 25 Nginx Web Server Best Security Practices

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;

Prevent large payloads from overwhelming your server by setting a limit on the size of client requests.

Sep 24, 2024
Read More
Tutorial
json bash

Building Progressive Web Apps (PWAs) with Modern APIs

Open manifest.json and add the following content:

{
  "name": "My Progressive Web App",
  "short_name": "MyPWA",
  "start_url": "/index.html",
  "display": "standalone",
  "background_color": "#ffffff",
  "theme_color": "#4a90e2",
  "icons": [
    {
      "src": "images/icon-192x192.png",
      "sizes": "192x192",
      "type": "image/png"
    },
    {
      "src": "images/icon-512x512.png",
      "sizes": "512x512",
      "type": "image/png"
    }
  ]
}

Aug 05, 2024
Read More

Discussion 0

Please sign in to join the discussion.

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