Skip to content

Instantly share code, notes, and snippets.

@joshlevinson
Last active August 3, 2019 01:54
Show Gist options
  • Save joshlevinson/e2a5a42da96821f228d6 to your computer and use it in GitHub Desktop.
Save joshlevinson/e2a5a42da96821f228d6 to your computer and use it in GitHub Desktop.
My xampp config
# xampp/apache/conf/extra/httpd-vhosts.conf
# You can replace the contents or append this
NameVirtualHost *:80
UseCanonicalName Off
#
# My {sites-directory} is C:\xampp\htdocs\domains\ (full path)
# In the domains dir, I create a new dir for a new site
# No extension needed, so for example.dev create dir "example"
# now works with subdomain multisite. simply forwards foo.bar.dev too the "bar" directory
#
<VirtualHost *:80>
ServerAlias localhost *.*.dev
VirtualDocumentRoot C:/xampp/htdocs/domains/%1
UseCanonicalName Off
</VirtualHost>
<VirtualHost *:80>
ServerAlias localhost *.dev
VirtualDocumentRoot C:/xampp/htdocs/domains/%-2+
UseCanonicalName Off
</VirtualHost>
# xampp/apache/conf/httpd.conf
# Obviously don't just replace your .conf with this
# Just search for vhosts.conf and make sure the Include isn't commented out
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment