【发布时间】:2012-03-27 02:32:05
【问题描述】:
注意到 Apache 的奇怪行为。 我正在使用 mod_rewrite 重定向每个
RewriteCond %{REQUEST_URI} !^.*css|gif|js|png$
RewriteRule ^(.*)$ index.php?q=$1 [QSA]
所以当我输入 www.example.com/something
在浏览器中,在 index.php 中 $_REQUEST['q'] 返回 'something'
但除了 index.php 之外,根文件夹中还有一些其他的 php 文件(例如 profile.php)。
所以当我输入时
www.example.com/profile
inside index.php $_REQUEST['q'] 返回 'profile.php'
为什么会出现这个.php?
【问题讨论】:
标签: php apache mod-rewrite