Reputation: 15
I want to redirect
/about
/about/
/about.html
/about.html/
/weare/
/weare
/weare.html
/weare.html/
All these pages should be redirected to about.html
and I want to do this with .htaccess.
I wast trying by
RewriteRule ^(about|weare).*/ about.html [R=Permanent]
This is somewhat working, but not exactly what I want. It is also redirecting some other pages.
I have added as said by ThinkingMonkey
If you want to do a permanent redirect:
RewriteCond %{REQUEST_URI} !^/about\.html$ [NC]
RewriteRule ^(about|weare)(\.html)?/?$ about.html [L,R=301]
This is working But it is going for infinite loop.
Upvotes: 0
Views: 139
Reputation: 12727
Do this:
RewriteRule ^(about|weare)(/|\.html/?)?$ about.html [L]
If you want to do a permanent redirect:
RewriteCond %{REQUEST_URI} !^/about\.html$ [NC]
RewriteRule ^(about|weare)(\.html)?/?$ about.html [L,R=301]
Upvotes: 1