开发者

htaccess mod_rewrite & apache2 not rewriting forward slash

In my .htaccess file, a mod_rewrite that I use works on some Apache 2 servers but not on others. For example, this rewrite works on a开发者_如何学编程ll Apache2 servers:

RewriteRule ^index-stormwatch.html$ index.php?action=stormwatch 

But when I replace the hyphen with a forward slash in the mod_rewrite like below...

RewriteRule ^index/stormwatch.html$ index.php?action=stormwatch 

...some Apache 2 servers will give me a 404 error (but not all). Is my mod_rewrite improperly written or do I need to edit the httpd.conf file (or another file) so that the forward slash '/' will be accepted by apache? All mentioned servers are Apache 2/php5.


Can you like this:

RewriteRule ^index/stormwatch\.html$ /index.php?action=stormwatch [NC,L,QSA]

That should take care of URI /index/stormwatch.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜