Created
May 3, 2019 15:10
-
-
Save hhrealestatemedia/7da788c4d51266a9dab43f7bd514c155 to your computer and use it in GitHub Desktop.
Force SSL for WordPress when using Cloudflare, needs the Proto header to prevent the redirect loop. Add this block before the WordPress rules.
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
#Force to https | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTPS} !on | |
RewriteCond %{SERVER_PORT} !^443$ | |
RewriteCond %{HTTP:X-Forwarded-Proto} !https | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment