Created
April 17, 2011 02:46
-
-
Save bmsterling/923704 to your computer and use it in GitHub Desktop.
Allows you to create subdomains on the fly w/out you having to create them in your cpanel
This file contains hidden or 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
RewriteEngine On | |
RewriteBase / | |
# redirects subX.subY.domain.com to /-client/subY/subX | |
RewriteCond %{REQUEST_URI} !^/- | |
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.([^\.]+) | |
RewriteCond %{DOCUMENT_ROOT}/-clients/%3/%2 -d | |
RewriteRule ^(.*)$ -clients/%3/%2/$1 [L] | |
# redirects subY.domain.com to /-client/subY/ | |
RewriteCond %{REQUEST_URI} !^/- | |
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+) | |
RewriteCond %{DOCUMENT_ROOT}/-clients/%2 -d | |
RewriteRule ^(.*)$ -clients/%2/$1 [L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment