好吧,我有一个愚蠢的问题,但我可能是愚蠢的:)
我有这个简单的.htaccess:
Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^news/([^/]+)$ news-inside.php?n=$1 [L] RewriteRule ^news/?$ news.php [L] RewriteCond %{REQUEST_FILENAME} !-f
每次我尝试通过键入一些这样的网址来进入第一个规则:
HTTP://主机/新闻/某事
我被重定向到文件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)
有任何想法吗??
尝试禁用MultiViews
:
Options -MultiViews