Created
August 3, 2017 21:43
-
-
Save eder-dias/e6570ebdbacb3015738295f57c571fc5 to your computer and use it in GitHub Desktop.
Redirect from non-www to www and HTTP to https.
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} ^yoururl.com [NC] | |
RewriteRule ^(.*)$ http://www.yoururl.com/$1 [L,R=301,NC] | |
RewriteEngine On | |
RewriteCond %{HTTP:X-Forwarded-Proto} !https | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment