Skip to content

Instantly share code, notes, and snippets.

@tomardern
Created March 28, 2014 12:44
Show Gist options
  • Save tomardern/9831882 to your computer and use it in GitHub Desktop.
Save tomardern/9831882 to your computer and use it in GitHub Desktop.
Apache Wildcard Virtual Hosts
1. Enable 'LoadModule vhost_alias_module modules/mod_vhost_alias.so' within http.conf
2. Add the following to /extras/httpd-vhosts.conf
<VirtualHost *:80>
UseCanonicalName Off
VirtualDocumentRoot "C:/__HTDOCS/%0"
LogFormat "%h $v %V %f %t \"%r\" %>s %b" common
CustomLog logs/404_logging.log combined
</VirtualHost>
3. Set the domain to resolve to 127.0.0.1 within HOSTS
4. Requests for the hostname whatever.whatever.com will be served from C:/__HTDOCS/whatever.whatever.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment