Http to Https not redirecting
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://domain.com
doesn't convert into
-
Why don't you use the "Redirections" option in cPanel to setup the rule? that would be the easiest and for sure it will work! :) 0 -
Hey there! I've had good luck with using the following for redirection for many years, so you may want to try this: RewriteCond %{HTTP_HOST} ^domain.com RewriteCond %{HTTP_HOST} !^domain.com RewriteRule (.*) http://www.domain.com/$1 [R=301,L] RewriteCond %{SERVER_PORT} !443 RewriteRule (.*) https://www.domain.com/ [R]
You could also use the redirection tool that @andrew.n mentions.0
Please sign in to leave a comment.
Comments
2 comments