Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

301 redirect problem 3 level "directory structure"

6:37 am on Dec 11, 2012 (gmt 0)

Junior Member

5+ Year Member

joined:Mar 12, 2010
posts: 49
votes: 0


I had to redirect about 60 pages like below:

Redirect 301 /property/randburg/r1-45952 http://www.example.com/residential/property/randburg
Redirect 301 /property/bryanston/b1-67706 http://www.example.com/residential/property/bryanston

Redirect 301 /property/illovo http://www.example.com/residential/property/illovo
Redirect 301 /property/broadacres-ah http://www.example.com/residential/property/broadacres

But when i visit this link on the old domain:


..it redirects to

It adds this at the end: /r1-45952

It only happens with url with characters similar to /r1-45952 at the end, all other redirects work fine.

I've tried organizing the 301 redirects to most specific first, most general last

But I'm still experiencing the problem.

Any fix for this ?
7:41 am on Dec 11, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

joined:Apr 9, 2011
votes: 244


..it redirects to

Key difference between mod_rewrite (RewriteRule, which can make a redirect) and mod_alias (Redirect by that name): mod_alias reappends the rest of the path.

Somewhere you've got a rule that redirects


or possibly


Anything that originally came after /property/ will be reattached after /property/ in the redirect.

Solution is to change everything from mod_alias to mod_rewrite. If you've got a text editor that does Regular Expressions, you can do it all in a couple of global search-and-replace operations.

You'll never look back ;)
10:18 am on Dec 11, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
votes: 0

Use RewriteRule configured as a 301 redirect for all of your rules. Make sure the rule target includes both protocol and hostname.

Make sure your non-www/www canonicalisation redirect is last in the list.