Page 1 of 1

Problem with setting catch-all style subdomain on Win/Apache

Posted: Fri Sep 02, 2005 10:51 am
by webvand
Just wondering / looking for how to setup a catch-all style for my localhost based on Windows/Apache.
I’ve set up Virtual Host (httpd.conf & windows hosts file) successfully. So I have a “sample.com” that points to sample folder (“rootdir\sample\”).
Now how can catch all of the requests like “*.sample.com” and point them to “rootdir\sample\index.php” to have something dynamic?
I guess I need something like the following in my windows “hosts” file (But * sign doesn’t work):

Code: Select all

127.0.0.1	*.something.com
Is there something necessary to my httpd.conf (ServerAlias? How?)? or both of hosts file and conf file?

Any idea will appreciate…

Posted: Fri Sep 02, 2005 12:34 pm
by timvw
I don't think you can do it with a flat hosts file..

You could use a DNS server for this...

Posted: Fri Sep 02, 2005 1:33 pm
by webvand
Well, if so where can I find one?

Posted: Fri Sep 02, 2005 4:20 pm
by timvw
A simple websearch will do, i used for example "windows dns server" and got a nice load..

Btw, i presume you are using a Server edition of (whatever) Windows is delivered with a (not completely rfc compliant) dns server. If i'm not mistaken there is also a win32 port of BIND8 and BIND9.