Skip to content

Instantly share code, notes, and snippets.

@eduardoromero
Created December 22, 2015 22:52
Show Gist options
  • Select an option

  • Save eduardoromero/2b0c2aedae843402a91c to your computer and use it in GitHub Desktop.

Select an option

Save eduardoromero/2b0c2aedae843402a91c to your computer and use it in GitHub Desktop.
Hosts multpile wildcard vhosts, makes [somename].dev/webroot -> http://somename.dev
<Directory "/">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Virtualhost *:80>
VirtualDocumentRoot "/Users/eromero/Workspace"
ServerName home.dev
UseCanonicalName Off
</Virtualhost>
<Virtualhost *:80>
VirtualDocumentRoot "/Users/eromero/Workspace/%1/webroot"
ServerName sites.dev
ServerAlias *.dev
UseCanonicalName Off
<Directory "/Users/eromero/Workspace/%1/webroot">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</Virtualhost>
@eduardoromero
Copy link
Author

Publishes /folder/hostname.dev/webroot visible in http://hostname.dev

Add hostname.dev in /etc/hosts accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment