我有这个简单的.htaccess:
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^news/([^/]+)$ news-inside.php?n=$1 [L]
RewriteRule ^news/?$ news.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
每当我尝试通过键入一些这样的网址来进入第一个规则时:
我被重定向到news.php文件,而不是带有查询字符串的news-inside.php!
查看到达页面的$ _GET和$ _SERVER,结果如下:
$_GET => empty
$_SERVER (some)
'REQUEST_METHOD' => string 'GET' (length=3)
'QUERY_STRING' => string '' (length=0)
'REQUEST_URI' => string '/news/something' (length=15)
'SCRIPT_NAME' => string '/news.php' (length=9)
'PATH_INFO' => string '/something' (length=10)
'PATH_TRANSLATED' => string '/var/www/rolo/something' (length=23)
'PHP_SELF' => string '/news.php/something' (length=19)
任何想法??