所以我在 htaccess 文件中有以下重写:
RewriteRule ^([^/.]+)/?$ index.php?page=$1 [L]
每当我尝试访问时,http://domain/index
我都会得到 404,但是当我尝试访问http://domain/index.
甚至不存在的页面http://domain/a
时,重写工作正常,并且 index.phpvar_dump()
是适当的值。
index.php 中唯一的代码是var_dump($_GET);
,所以我知道这不是 php 问题。
有人可以向我解释我的重写规则有什么问题,并解释如何解决它吗?
编辑: 我忘了我启用了错误日志记录。它一直保存到 error.log 的错误是:
[Sun Feb 24 21:01:18 2013] [error] [client 192.168.1.1] Negotiation: discovered file(s) matching request: /path/public_html/index (None could be negotiated).