Last active
December 27, 2015 14:39
-
-
Save John2496/7341965 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Use name-based virtual hosting. | |
# | |
NameVirtualHost *:80 | |
<VirtualHost *:80> | |
RewriteEngine On | |
RewriteMap lowercase int:tolower | |
# If already rewitten and we have the right path, stop right here | |
RewriteCond /var/www/vhosts/${lowercase:%{SERVER_NAME}/public} !-d | |
RewriteRule ^/(.*)$ /var/www/vhosts/_default/public/$1 [L,E=VHOST_ROOT:/var/www/vhosts/_default/public] | |
RewriteRule ^(/var/www/vhosts/[^/]+/.*)$ $1 | |
RewriteRule ^(.+) ${lowercase:%{SERVER_NAME}}$1 | |
# Strip out dev subdomain from hostname | |
##RewriteRule ^(.*).dev.(.*) $1.$2 | |
#RewriteRule ^(.*)dev.(.*) $1$2 | |
#RewriteRule ^(.*).dev(.*) $1$2 | |
RewriteRule ^(www\.)?([^/]+)/(.*)$ /var/www/vhosts/$2/public/$3 [E=VHOST_ROOT:/var/www/vhosts/$2/] | |
Options +Indexes +FollowSymLinks | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment