homepage Welcome to WebmasterWorld Guest from 54.205.207.53
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
From many to one domain
Bilet



 
Msg#: 4651284 posted 9:24 am on Mar 5, 2014 (gmt 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.

Eirik.

 

lucy24

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



 
Msg#: 4651284 posted 9:52 am on Mar 5, 2014 (gmt 0)

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
example.com/test
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.)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved