Skip to content

Instantly share code, notes, and snippets.

@GhazanfarMir
Last active October 1, 2016 22:43
Show Gist options
  • Save GhazanfarMir/c389a5b978fd06e9edcf4eb98999e59f to your computer and use it in GitHub Desktop.
Save GhazanfarMir/c389a5b978fd06e9edcf4eb98999e59f to your computer and use it in GitHub Desktop.
Apache Virtual Hosts with Wildcards in case of Multi sites setup in sub domain
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/opt/lampp/htdocs/demo"
ServerName demo.ghazanfarmir.local
ServerAlias *.demo.ghazanfarmir.local # fr.demo.ghazanfarmir.local, de.demo.ghazanfarmir.local, ch.demo.ghazanfarmir.local
<Directory "/opt/lampp/htdocs/demo">
Options Indexes FollowSymLinks Includes execCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
# Note that the ServerName remains as the domain,
# however, ServerAlias uses the wildcard instead of specifying each sub domain.
# Please remember, you hosts file still needs to have individual sub-domain
# declaration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment