为什么这个重写规则会给我这个错误?

时间:2015-12-10 19:06:11

标签: apache mod-rewrite url-rewriting

我试图重写

http://localhost/messages/index.php?s=compose

http://localhost/messages/compose

但它给了我Internal Server Error

RewriteEngine On
RewriteRule ^messages/([^/]*)$ /messages/index.php?s=$1 [L]

我正在使用一个在线网站,您可以在其中生成规则以便它可以正常工作,在网站上我可以制定规则将其重写为http://localhost/compose.html,但有效并没有给我任何错误,但重写为http://localhost/messages/compose给我错误。

Mod重写引擎已启用

是否与消息是文件夹/目录这一事实有关?

1 个答案:

答案 0 :(得分:0)

排除模式中的点。

RewriteEngine On
RewriteRule ^messages/([^/.]*)$ /messages/index.php?s=$1 [L]
相关问题