Created
July 28, 2014 17:48
-
-
Save jimrubenstein/5f5de7c01ff220017e98 to your computer and use it in GitHub Desktop.
Dynamic sub-domain -> sub-folder webroot rewriting (more documentatino here: http://stackoverflow.com/a/17890602/109026)
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
# goes in folder that holds symlinks to project files (/home/jim/sites/dev) | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^([^.]+)\.local.dev | |
RewriteCond %1::%{REQUEST_URI} !^(.*?)::/\1/ | |
RewriteRule ^(.*)$ /%1/$1 [L] | |
RewriteCond %{HTTP_HOST} ^([^.]+)\.dev\.local | |
RewriteCond %1::%{REQUEST_URI} !^(.*?)::/\1/ | |
RewriteRule ^(.*)$ /%1/$1 [L] |
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
<VirtualHost *:80> | |
ServerName local.dev | |
ServerAlias *.local.dev *.local | |
DocumentRoot "/home/jim/sites/dev" #folder for symlinks to project files | |
Options Indexes FollowSymLinks | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment