Created
June 3, 2022 15:29
-
-
Save royce002/d05d0cf21654563d882df140b77d7d77 to your computer and use it in GitHub Desktop.
Redirect to https and non-www .htaccess
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
# Canonical HTTPS/non-WWW | |
<IfModule mod_rewrite.c> | |
RewriteCond %{HTTPS} off [OR] | |
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC] | |
RewriteRule (.*) https://example.com/$1 [L,R=301] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment