Forum Moderators: phranque

Message Too Old, No Replies

301 redirect 100s of subdomains, HOW?

can this be done on .htaccess?

         

xinnek

4:29 am on Jan 17, 2006 (gmt 0)



I bought a domain <snip> that has hundred of cached pages on google. I was trying to do a simple 301 redirect but all of the pages are in sub domains. (ie. new-dodge-ram-super-duty.exampel.com/ , 1996-dodge-neon-sport.example.com/,) I want to redirect them to the new site I am opening... Can someone please help me with this. I'm completely stumped. Thanks in advance.

[edited by: jdMorgan at 3:02 pm (utc) on Jan. 17, 2006]
[edit reason] Removed/obscured specifics per TOS. [/edit]

jdMorgan

3:31 pm on Jan 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



xinnek,

Welcome to WebmasterWorld!

This can be done with two lines of code using mod_rewrite.

Check the requested subdomain using RewriteCond testing %{HTTP_HOST}. If present, and not equal to "www", then redirect to your main domain using a 301 permanent redirect.

For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].

Jim