Код: Выделить всё
example.com => /
example.com/ => /
example.com/index.php => /
example.com/path/to => /path/to/
example.com/path/to/ => /path/to/
example.com/path/to/index.php => /path/to/
Я подумал:
Код: Выделить всё
$path = rtrim(dirname(parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH)), '/') . '/';
Подробнее здесь: https://stackoverflow.com/questions/790 ... t-url-path
Мобильная версия