Created
May 3, 2016 17:11
-
-
Save drakemccabe/0b01ae68ad535e1d544cc157f0ff0b7a to your computer and use it in GitHub Desktop.
Rewrite urls to WWW without changing request's original protocol
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
RewriteCond %{HTTPS} !=on | |
RewriteCond %{HTTP_HOST} ^<HOST>.com$ [NC] | |
RewriteRule ^(.*)$ http://www.<HOST>.com/$1 [L,R=301] | |
RewriteCond %{HTTPS} =on | |
RewriteCond %{HTTP_HOST} ^<HOST>.com$ [NC] | |
RewriteRule ^(.*)$ https://www.<HOST>.com/$1 [L,R=301] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment