Created
November 5, 2018 16:32
-
-
Save mmansion/5bebce127e296b38d96019ac5301e698 to your computer and use it in GitHub Desktop.
.htaccess redirect for https (ssl certificate)
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
#handles both HTTP and www canonical redirects | |
# change the "302" to "301" only after you are sure it's working | |
RewriteEngine On | |
RewriteCond %{HTTPS} !on [OR] | |
RewriteCond %{HTTP_HOST} ^www\. [NC] | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=302,L,NE] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment