0

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)

4

1 回答 1

2

利用$_SERVER['REQUEST_URI']

http://php.net/manual/en/reserved.variables.server.php

于 2012-08-02T01:12:18.860 回答