Last active
May 25, 2016 11:41
-
-
Save edheltzel/2e5ee6a0c28d166927a02502d97b5c20 to your computer and use it in GitHub Desktop.
route subdomain requests to directory
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
ErrorDocument 404 / | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{HTTP_HOST} ^([a-z0-9\-]+)\.domain\.com$ [NC] | |
RewriteCond %1 !^www$ [NC] | |
RewriteRule (.*) http://domain.com/%1 [R=301,L,NC] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment