Last active
April 20, 2018 08:47
-
-
Save sigu/ebee18b78fd2978aaf2a7ece3aec5815 to your computer and use it in GitHub Desktop.
Redirect all non http to https versions of the webite in cpanel
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
#Comment | Uncomment ''RewriteEngine on'' below if it is not in your public_html .htaccess file | |
#You only need to have this once in the public_html .htaccess as it covers all other Rewrites | |
RewriteEngine on | |
#Comment | Force all URLs to https WITHOUT www | |
RewriteCond %{SERVER_PORT} 80 | |
RewriteRule ^(.*)$ https://example.com/$1 [R,L] | |
#Comment | Force all URLs to https WITH www | |
RewriteCond %{SERVER_PORT} 80 | |
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment