PDA

View Full Version : Wildcard subdomains redirect?


RealNames
04-12-2004, 02:30 AM
I have a small website where there was a bunch of subdomains and traffic going to the subdomains from the old website prior to my purchase of the domain.

Do not know the names of the subdomains so need to use a wildcard so that traffic is not lost and goes to my index.html page.

Can someone please tell me in simple terms (even a non-experienced DA reseller & a non-geek can understand) how to set that up? Thanks.
.

DirectAdmin Support
04-12-2004, 10:52 AM
Hello,

Go to your Dns Control and add the following "A" record.

* A 1.2.3.4

where 1.2.3.4 is your IP address. That will ensure that anything.yourdomain.com will resolve.

Next, you need to setup a ServerAlias to handle the *. You'll need admin access on the server to do this, but you go to:

Admin Panel -> Admin Settings -> Custom Httpd.conf -> yourdomain.com.

In the textarea, just paste:

ServerAlias *.|DOMAIN|

and click save. This will make all subdomains point to your webpage. (Note that *all* subdomains will point to your webpage as the * takes priority over real subdomains because the VirtualHost appears first in the httpd.conf file.)

John

resolve-it
04-16-2004, 07:45 AM
Hi John,

Is it possible to add this functionality (but then for all undefined sub-domains)? I know that some of my users would be very happy with this feature.

Kind REgards,
Onno Vrijburg

DirectAdmin Support
04-16-2004, 09:57 AM
Hello,

I'll consider that for a future release :)

John

resolveit
04-16-2004, 12:53 PM
:) Thanks! :)

RealNames
06-03-2004, 09:02 PM
Originally posted by DirectAdmin Support
Hello, Go to your Dns Control and add the following "A" record.
* A 1.2.3.4 where 1.2.3.4 is your IP address. That will ensure that anything.yourdomain.com will resolve.....

Thanks but I am confused on if this will work correctly since there are about 15 sites using each IP Address, will that effect all the sites? How would the system know which site to send the wildcard subdomain too? i.e. only 5 of the 15 need the wildcard subdomain but all 5 and the other 10 are on the same IP.

jlasman
06-03-2004, 09:59 PM
If you use a wildcard DNS record, then any subdomain request not already defined in the DNS zone file will be responded to with that IP#.

So to use a different IP# for a specific subdomain, just create an A record for that subdomain in the same zone file.

Jeff

Rick
11-26-2004, 02:55 PM
We've set this up, but it does not work. We've restarted named and apache.

Does someone know how to fix this?

With regards,
:(

resolveit
11-26-2004, 03:45 PM
You need to add it to the custom httpd.conf file for that user as well otherwise it wont work.

Regards,
Onno

jlasman
11-26-2004, 04:45 PM
The reason I didn't mention Onno's fix is because I presumed the original poster was creating subdomains using DA, which should add the code to the httpd.conf file.

Did I miss something?

Jeff

Rick
11-26-2004, 05:37 PM
Originally posted by resolveit
You need to add it to the custom httpd.conf file for that user as well otherwise it wont work.

Regards,
Onno

We applied the "wildcard" to httpd aswell, only the names do not resolve.

With regards, :)