Skip to content

Instantly share code, notes, and snippets.

@bramus
Created February 9, 2015 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bramus/4f79972b1927ffb9b1f8 to your computer and use it in GitHub Desktop.
Save bramus/4f79972b1927ffb9b1f8 to your computer and use it in GitHub Desktop.
Wampserver Virtual Vhosts

To make websites placed in C:\wamp\www\bramus.vandamme\labo01\public_html also available via http://labo01.bramus.vandamme.127.0.0.1.xip.io/ (next to http://localhost/bramus.vandamme/labo01/public_html) via Wampserver, follow these steps:

  1. Open C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf and remove the # before the line that reads #IncludeOptional "c:/wamp/vhosts/*"
  2. Create the file C:\wamp\vhosts\students.conf (see other file attached to this gist)
  3. Restart wampserver.
# Use name-based virtual hosting.
NameVirtualHost *:80
UseCanonicalName Off
<VirtualHost *:80>
DocumentRoot "c:/wamp/www"
ServerName localhost
<Directory "c:/wamp/www">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAlias *.127.0.0.1.xip.io
VirtualDocumentRoot "c:/wamp/www/%2.0.%3/%1/public_html"
<Directory "c:/wamp/www">
Options Indexes FollowSymLinks MultiViews
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