Skip to content

Instantly share code, notes, and snippets.

@tuupola
Created November 4, 2011 15:40
Show Gist options
  • Save tuupola/1339618 to your computer and use it in GitHub Desktop.
Save tuupola/1339618 to your computer and use it in GitHub Desktop.
Automatic virtual hosts
<VirtualHost *:80>
ServerAdmin webmaster@localhost
VirtualDocumentRoot "/Users/tuupola/Code/www/%0/htdocs"
ServerName dev.subdomains
ServerAlias dev.*
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
ErrorLog "/Users/tuupola/Code/www/logs/vhosts-error_log"
CustomLog "/Users/tuupola/Code/www/logs/vhosts-access_log" vcommon
</VirtualHost>
<Directory "/Users/tuupola/Code/www/*/htdocs">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
function FindProxyForURL(url, host) {
if (shExpMatch(host, "dev.*")) {
return "PROXY localhost";
}
return "DIRECT";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment