Web Hosting Talk







View Full Version : Custom error pages?


cobramarv
12-17-2004, 01:00 AM
I have just purchased a domain that had about 2,000 sub domains previously. I would like the traffic going to these subdomains to be redirected to my homepage. I have tried to use .htaccess and custom error pages. Not sure if maybe, I am doing something wrong. The custom error pages work fine for www dot mydomain dot com/somefilethatdoesntexist dot html but it does not work for somenonexistantdomain dot mydomain dot com

How can I get the old sub domains to re-direct to my home page, without having to figure out the domains and creating all the sub domains.

Thanks, any help is appreciated!


Sorry I'm not allowed to post uls in my example since I have not made 5 posts. The urls are only examples, not real.

IntraHost
12-17-2004, 02:39 AM
I'd setup a wildcard in your DNS record on the machine. So *.domain.com will go to domain.com.

Here's a good howto page:
http://steinsoft.net/index.php?site=Programming/Articles/apachewildcarddomain

Wildcards is how we ran our old free url redirection program. So *.domain.com would go to domain.com and the script there would then determine the referrer (mysite.domain.com) and then send them off to mysite's webpage.

cobramarv
12-17-2004, 08:16 PM
Thank you very much for your help!