Say I'm trying to access:
mysite.com/foo/bar/
I want too:
RewriteEngine On
RewriteCond %{REQUEST_URI} !=/index.php
RewriteRule .* /index.php
Then:
$url = $_SERVER['PHP_SELF'];
echo $url;
To show:
foo/bar/
Currently getting:
index.php
(Obviously I have no idea, but you get the point for what I'm trying to achieve)
Use $_SERVER['REQUEST_URI']
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.