Created
December 1, 2009 19:11
-
-
Save kevburnsjr/246542 to your computer and use it in GitHub Desktop.
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
# Force WWW for http | |
RewriteCond %{HTTPS} off [NC] | |
RewriteCond %{HTTP_HOST} !^www\.[a-z-]+\.?[a-z]{2,6}? [NC] | |
RewriteCond %{HTTP_HOST} ([a-z-]+)(\.[a-z]{2,6})?$ [NC] | |
RewriteRule ^(.*)$ http://www.%1%2/$1 [R=301,L] | |
# Force WWW for https | |
RewriteCond %{HTTPS} on [NC] | |
RewriteCond %{HTTP_HOST} !^www\.[a-z-]+\.?[a-z]{2,6}? [NC] | |
RewriteCond %{HTTP_HOST} ([a-z-]+)(\.[a-z]{2,6})?$ [NC] | |
RewriteRule ^(.*)$ https://www.%1%2/$1 [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment