Forum Moderators: phranque

Message Too Old, No Replies

.htaccess to 301 redirect ALL possible wildcard subdomains to main TLD

I've asked on several forums, and searched the archives... nada!

         

rollinj

7:48 pm on Jun 22, 2006 (gmt 0)

10+ Year Member



I'm having the absolute hardest time with [my host] at the moment.

All I need is for whenever any possible subdomain is typed into the browser window, I want the main domain to show up.

ex. type-in asdfasgasd.domain.com 301 redirect to domain.com
type-in ewoiuyojwygklasdrhgl.domain.com 301 redircts to domain.com as well

I don't know exactly which sub-domains I need to redirect and I suspect there are thousands of them as this is an old comment-spammed domain that I just recently purchased.

Ex. The spammer spammed links to keyword.domain.com and fun-keyword.domain.com however there's not a single link pointing to the actual domain.com - so I need to 301 redirect EVERY possible subdomain in the hopes that Yahoo/MSN (definitely not Google) might give me some credit for the links?

Any and all help is much appreciated.

PS. I've created wildcard DNS for all the domains I'm trying to redirect... I just dont have the htacces code

[edited by: jdMorgan at 9:20 pm (utc) on June 22, 2006]
[edit reason] Obscured specifics per TOS. [/edit]

jdMorgan

3:32 am on Jun 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not sure why you're having a hard time finding it -- It's probably the most-often-posted code here.

See msg#2 of this thread [webmasterworld.com].

Jim

rollinj

8:05 pm on Jun 23, 2006 (gmt 0)

10+ Year Member



Thanks for the quick replies! I've found what I'm looking for, thanks again!

jdMorgan

1:29 pm on Jun 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Glad you got it working!

Jim

john1000

1:20 pm on Jun 25, 2006 (gmt 0)

10+ Year Member



this is a wellknown way of spamming...
did you helped a spammer perhaps jim?