【发布时间】:2011-08-31 14:13:04
【问题描述】:
在设置 mod_rewrite 时,我似乎无法通过 Bad Request 错误。我已经尝试了一段时间,所以这就是我所拥有的。
我要访问的网址是:
gordons.local/brewCalc
我想看的页面是
gordons.local/index.php?page=brewCalc
这是我的重写规则:
RewriteEngine on
RewriteLog /var/www/gordons.com/logs/rewrite.log
RewriteRule ([^/]+)/?$ index.php?page=$1 [L]
我使用了一个正则表达式工具和this tool,但无论如何我最终都会得到一个页面,上面写着:
Bad Request
Your browser sent a request that this server could not understand.
Additionally, a 400 Bad Request error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.12 (Ubuntu) Server at gordons.local Port 80
另外,我的访问、错误或重写日志中没有任何信息。
编辑:我的重写规则在我的虚拟主机文件中。 (/etc/apache2/sites-available/gordons.local)
【问题讨论】:
-
你可以在禁用 mod_rewrite 的情况下直接访问 index.php 吗?
标签: mod-rewrite