B6431
B6431

Reputation: 317

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 all 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.

Upvotes: 2

Views: 611

Answers (1)

anubhava
anubhava

Reputation: 785128

Can you like this:

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

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

Upvotes: 1

Related Questions