Skip to content

Instantly share code, notes, and snippets.

@karthikax
Last active December 29, 2022 20:04
Show Gist options
  • Save karthikax/ac9ed21055ee6cb8dddc to your computer and use it in GitHub Desktop.
Save karthikax/ac9ed21055ee6cb8dddc to your computer and use it in GitHub Desktop.
Adding virtual hosts in wamp (For any Directories)
//Add to hosts file in "C:\Windows\System32\drivers\etc\"
127.0.0.1 newsite
//Access your new directory via "http://newsite"
<VirtualHost newsite>
DocumentRoot "F:/path"
ServerName newsite
<Directory "F:/path">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
// apache 2.4 ▼
<VirtualHost newsite>
DocumentRoot "F:/path"
ServerName newsite
<Directory "F:/path">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<Directory />
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride none
// Delete deny line, if any
</Directory>
#
#
# Virtual hosts
Include 'D:/Softwares/wamp/bin/apache/apache2.4.9/conf/extra/httpd-vhosts.conf'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment