Skip to content

Instantly share code, notes, and snippets.

@evanpurkhiser
Created May 2, 2012 08:49
Show Gist options
  • Save evanpurkhiser/2575231 to your computer and use it in GitHub Desktop.
Save evanpurkhiser/2575231 to your computer and use it in GitHub Desktop.
<VirtualHost *:80>
Servername dd.h1x.com
ServerAdmin [email protected]
DocumentRoot /var/www
RewriteEngine on
RewriteLog rewrite.log
RewriteLogLevel 9
# Stop internal redirects here
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [L]
# Rewrite to a project directory
RewriteCond %{SERVER_NAME} !^www\.dd\.h1x\.com$ [NC]
RewriteCond %{SERVER_NAME} ^(www\.)?([a-z0-9-]+)\.dd\.h1x\.com$ [NC]
RewriteCond %{DOCUMENT_ROOT}/%2 -d
RewriteRule .* /%2/$0 [L]
# Rewrite default to the digitaldepth project
RewriteRule .* /digitaldepth/$0 [L]
<Directory "/home/evan/web_accessible/">
RewriteBase /
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment