Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

From many to one domain

9:24 am on Mar 5, 2014 (gmt 0)

New User

joined:Mar 5, 2014
votes: 0

I've got multiple domains redirected to my site via 301.

domain1.com leads to domain.com/1
domain2.com leads to domain.com/2
domain3.com leads to domain.com/3

All this works fine, but when I get traffic to the following addresses:
domain1.com/test the url on my site redirects to domain.com/1test.

How could I via .htaccess and the webserver I use on domain.com get all the traffic to domain1.com to just redirect to domain.com/1 without adding the subpages to the end of the redirect?

I don't have any hosts on the domain1.com, domain2.com etc. The domain just have an www-redirect via 301 to domain.com/1/2/3 etc.

Any help would be much appreciated.

9:52 am on Mar 5, 2014 (gmt 0)

Senior Member from US 

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

joined:Apr 9, 2011
votes: 348

Not enough information. How are the redirects currently being done? Mechanically, that is. "Via 301" doesn't say anything: a response code is an end, not a means.

A form like
example.se/test >> example.no/1test
can only happen if someone is explicitly capturing and reappending-- though it's being done in a shockingly sloppy way, if so. Seems like you could get the result you want by reducing the rules rather than expanding them.

How do those
requests arise in the first place? Are they URLs that used to exist and have been discontinued? Or type-ins where they got the name wrong? I've got one domain whose htaccess says in full
RewriteRule ^([^.]+\.php) http://www.example.ca/$1 [R=301,L]

because anyone who goes to the trouble of typing in a full URL down to the last .php deserves to be sent straight to the correct page, even if it isn't my own site! (This has never actually happened, but it's just as well to be safe.)