301 Redirect for localhost/*/path to loalhost/*/path/
Similar questions have been asked before but it isn't clear!
I have a folder structures like these:
http://example.com/category1/subcat1/path1
http://example.com/category2/subcat2/path2
http://example.com/category3/subcat3/path3
I want to redirect them to the following respectively:
http://example.com/category1/subcat1/stuff1
http://example.com/category2/subcat2/stuff2
http://example.com/category3/subcat3/stuff3
Notice: I need any request to example.com/path to redirect to
example.com/path/ if example.com/path doesn't exist!
I tried this:
RewriteEngine On
RewriteBase /var/www/
RewriteRule ^path1/$ path1 [R=301,L]
RewriteRule ^path1/(.*)$ path1 [R=301,L]
Pls, any help?
No comments:
Post a Comment