Created
January 23, 2010 23:30
-
-
Save jjulian/284856 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
# To rewrite server subdomains into directories: Capture the subdomains | |
# in a rewrite condition, then use backreferences to them in the rule. | |
# . run apache locally | |
# . add project.client.staging.domain.com to /etc/hosts | |
# . curl project.client.staging.domain.com | |
# . in rewrite_log, you'll see rewrite '/' -> '/root/staging/client/project' | |
RewriteLogLevel 3 | |
RewriteLog "rewrite_log" | |
RewriteEngine On | |
ServerName project.client.staging.domain.com | |
RewriteCond %{SERVER_NAME} ^(.*?)\.(.*?)\.(.*?)\. | |
RewriteRule ^.*$ /root/%3/%2/%1 [L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment