Created
June 24, 2019 19:50
-
-
Save amsgator/aef668dadb729266a504a6e109957ab7 to your computer and use it in GitHub Desktop.
Redirect all traffic to https www in 1 hop
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# Redirect all naked http(s) to https www in 1 hop | |
RewriteCond %{HTTP_HOST} ^domain\.com [NC] | |
RewriteRule ^(.*)$ https://www\.domain\.com/$1 [R=301,L] | |
# Redirect all http www to https www in 1 hop | |
RewriteCond %{HTTPS} !on [NC] | |
RewriteRule ^(.*)$ https://www\.domain\.com/$1 [R=301,L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment