Last active
August 29, 2015 14:12
-
-
Save sethwhitaker/468e1900e96bebb22356 to your computer and use it in GitHub Desktop.
Custom vhosts (Mac OSX - webserver)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a Dynamic vhosts config. | |
# With this config, you wont need to add new entries for each project. | |
# Just add entry to hosts file | |
# Just replace all 'username' text with your actual machine username | |
# Reset for defualt localhost | |
<VirtualHost *:80> | |
DocumentRoot "/Users/username/Sites" | |
ServerName localhost | |
</VirtualHost> | |
# 1. Project root is the same as web root. | |
# Ex: /Users/foo/Sites/bar | |
# Hosts Entry: 127.0.0.1 bar.dev | |
<VirtualHost *:80> | |
UseCanonicalName Off | |
ServerAlias *.dev | |
VirtualDocumentRoot "/Users/username/Sites/%1" | |
<Directory "/Users/username/Sites/*"> | |
SetEnv ENV dev | |
Options Indexes FollowSymLinks | |
AllowOverride All | |
Order Allow,Deny | |
Allow from all | |
</Directory> | |
</VirtualHost> | |
# 2. Project web root one level deep. | |
# Ex: /Users/foo/Sites/bar/www | |
# Hosts Entry: 127.0.0.1 bar.local | |
# /www can be changed to anything which suits your projects | |
<VirtualHost *:80> | |
UseCanonicalName Off | |
ServerAlias *.local | |
VirtualDocumentRoot "/Users/username/Sites/%1/www" | |
<Directory "/Users/username/Sites/*/www"> | |
SetEnv ENV dev | |
Options Indexes FollowSymLinks | |
AllowOverride All | |
Order Allow,Deny | |
Allow from all | |
</Directory> | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment