Forum Moderators: phranque

Message Too Old, No Replies

301 whole directory (.htaccess)

need to also redirect pseudo-page with no trailing slash

         

steveb

11:07 pm on Oct 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks to a previous question I know this:

RedirectMatch permanent ^/dir1/ http://www.example.com/dir2/
will redirect all resquests to pages in in dir1 to the index page of dir2.

Now though I find Google is spewing up non-trailing slash duplicates (that don't redirect) with URLs like:
www.example.com/dir1

So, will this:
RedirectMatch permanent ^/dir1 http://www.example.com/dir2/
redirect do the same as above, with the single additional consequence of also redirecting the single extra URL of www.example.com/dir1
?

Are there no other consequences or dangers in doing this?

Or, should I just use what I did before, and include a second entry:
RedirectMatch permanent ^/dir1$ http://www.example.com/dir2/

I don't want to have unecessary entries, but also don't want to make a confusing or non-standard entry.

jdMorgan

11:23 pm on Oct 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The only danger would be if you have directories named (literally) dir1, dir10, dir11, etc., in which case they'd be redirected as well.

Jim