Дата публикации : 2024.01.22
Автор:Виноградов Александр
Рейтинг статьи:
How to get full url path in php
<?php
//all before $_SERVER['REQUEST_URI'] this is the hostname http(s)://your_domain.ru
//is responsible for the rest $_SERVER['REQUEST_URI']
$url = ((!empty($_SERVER['HTTPS'])) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];