Created
May 18, 2015 20:36
-
-
Save ali5h/9f70bd6f18bb61aa9cda to your computer and use it in GitHub Desktop.
Apache redirect rule: form an url path to subdomain
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
# Redirect /path to sub. | |
RewriteEngine on | |
RewriteCond %{REQUEST_URI} =/path [NC] | |
RewriteCond %{HTTPS}s ^on(s)|off | |
RewriteCond http%1://%{HTTP_HOST} ^(https?://)(www\.)?(.+)$ | |
RewriteRule ^ %1sub.%3 [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment