Skip to content

Instantly share code, notes, and snippets.

@jimmysawczuk
Forked from jimrubenstein/.htaccess
Created July 29, 2014 15:29
Show Gist options
  • Save jimmysawczuk/3a38e9b467998870b864 to your computer and use it in GitHub Desktop.
Save jimmysawczuk/3a38e9b467998870b864 to your computer and use it in GitHub Desktop.
# 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]
<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