Last active
July 9, 2022 23:22
-
-
Save vital-tech-results/5d1a0f62b873be2ed118384ae0c3a4c1 to your computer and use it in GitHub Desktop.
// source: https://www.namecheap.com/support/knowledgebase/article.aspx/9770/38/how-to-use-htaccess-to-redirect-to-https-in-cpanel // Redirect from http:// to https:// or https://www having CloudFlare Flexible SSL mode //a) Basic http:// to https:// redirection, but this block should be used along with CloudFlare Flexible SSL Mode
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 RewriteBase / RewriteCond %{HTTPS} !=on RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteCond %{HTTP_HOST} ^example\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.example\.com$ RewriteRule .* https://example.com%{REQUEST_URI} [R=301,L] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment