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

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
webvand
Forum Newbie
Posts: 4
Joined: Fri Sep 02, 2005 1:18 am

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

Post 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…
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

I don't think you can do it with a flat hosts file..

You could use a DNS server for this...
webvand
Forum Newbie
Posts: 4
Joined: Fri Sep 02, 2005 1:18 am

Post by webvand »

Well, if so where can I find one?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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.
Post Reply