Reputation: 1341
I've been trying to do the following with mod_rewrite
I tried something like this:
RewriteRule ^about/$ about.htm [L]
RewriteRule ^about\.htm$ about/ [R=302]
I also tried changing it a bit and see what happends, but I always end up with an infinite loop of redirection or a 500 server error.
Any idea why it's not working as intended?
Thanks in advance!
Upvotes: 1
Views: 980
Reputation: 655697
You need to test the path in the request line:
RewriteRule ^about/$ about.htm [L]
RewriteCond %{THE_REQUEST} ^GET\ /about\.htm
RewriteRule ^about\.htm$ about/ [R=302]
Upvotes: 2
Reputation: 29519
Only this line should do the work.
RewriteRule ^about\.htm$ http://yourdomain.com/about/ [R=302]
Upvotes: 0