Created
April 27, 2019 10:26
-
-
Save ixkaito/133c1640e9a512ae02475771e7597c11 to your computer and use it in GitHub Desktop.
Redirect www to non-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 %{HTTPS} off [OR] | |
RewriteCond %{HTTP_HOST} ^www\. [NC] | |
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC] | |
RewriteRule ^(.*)$ https://%1/$1 [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment