Forum Moderators: phranque

Message Too Old, No Replies

Dynamic Virtual Hosts in Windows

         

Eric The Red

12:41 am on Nov 2, 2007 (gmt 0)

10+ Year Member



Hi,

I would like to setup Dynamic Virtual hosts on my home computer for editing / testing websites. I already have several virtual hosts setup but would like them to be created dynamically.

I have the folling directory setup:

C:/Documents and Settings/Owner/My Documents/My Webs/MySiteA.com/www
C:/Documents and Settings/Owner/My Documents/My Webs/MySiteB.com/www
C:/Documents and Settings/Owner/My Documents/My Webs/MySiteC.com/www
C:/Documents and Settings/Owner/My Documents/My Webs/MySiteC.com/admin

I am thinking there is an easy way to automatically make

[mysiteb.dev...]
[mysitec.dev...]
[admin.mysitec.dev...]

map to the correct directory without having to add an individual vhosts entry for each domain and each subdomain.
I would like .com .net etc automatically changed to .dev on the local site so as not to confuse with the live site.

I am not worried about security as this is my private testing server.

I am thinking there is no easy way to to do the same with windows "hosts" file but it a few lines of script on the apache side can configure itself automatically it would be a big help in the long run. If you do know of a way to do basically the same thing with windows "hosts" I would love to hear about it. I have found something a little more complex in the apache manual under "mass dynamic virtual hosts" but I was hoping for a more simple dynamic approach.

Thanks!

Eric

jdMorgan

10:04 pm on Nov 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The "mass virtual hosts" approach outlined in the Apache docs can be simplified a little, but that's pretty much what it takes...

Jim