Created
December 22, 2016 15:36
-
-
Save DrewDouglass/3db9b8413ef35dd5d23a3d0217dc1d14 to your computer and use it in GitHub Desktop.
redirect http and www to https and non www.
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
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC] | |
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301] | |
RewriteCond %{SERVER_PORT} 80 | |
RewriteRule ^(.*)$ https://example.com/$1 [R,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment