Created
November 14, 2014 04:04
-
-
Save MaxLynam/c59837b77d4609aea4fc to your computer and use it in GitHub Desktop.
htaccess code sample . nice and efficient :)
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
| # Force 'www.' on HTTP protocol | |
| RewriteCond %{HTTP_HOST} !^www\. [NC] | |
| RewriteCond %{HTTP_HOST} !^$ | |
| RewriteCond %{HTTPS} !on | |
| RewriteRule ^/?(.*) http://www.%{HTTP_HOST}/$1 [L,R,NE] | |
| # Force 'www.' on HTTPS protocol | |
| RewriteCond %{HTTP_HOST} !^www\. [NC] | |
| RewriteCond %{HTTP_HOST} !^$ | |
| RewriteCond %{HTTPS} on | |
| RewriteRule ^/?(.*) https://www.%{HTTP_HOST}/$1 [L,R,NE] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment