Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Set up new virtual hosts by creating new folders' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Set up new virtual hosts by creating new folders
Authored by: krang on Dec 16, '08 08:19:59AM

There is another alternative, by using Apache rewrite rules:

http://www.craigfrancis.co.uk/features/setup/apache/

The main part of the linked document is:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^[a-z0-9]+(.[a-z0-9]+)*.[a-z]+.domain.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^([a-z0-9]+(.[a-z0-9]+)*).[a-z]+.domain.com(.*) /Library/WebServer/Projects/$1$3

Where the "domain.com" bit should be changed (or removed).

This system is setup to use URLs like:

http://project.name.server.domain.com

And with a locally running DNS server, you can wildcard the sub-domain "server.domain.com" to point to the localhost (or its IP, if you want multiple hosts to connect).

Details for the DNS setup can be found:

http://www.craigfrancis.co.uk/features/setup/bind/



[ Reply to This | # ]