Created
July 27, 2020 15:31
-
-
Save Maximization/fd1745fe21dda13bcbbc620ec195291d to your computer and use it in GitHub Desktop.
Redirect to non-www and https in one step with Apache
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 | |
RewriteCond %{HTTP:X-Forwarded-Proto} !https [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