This is the script I have right now, how do I have my script force all traffic to http, currently it is doing the exact opposite, it is forcing all traffic to https.
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
I've also tried this and it didn't work
RewriteEngine On
RewriteCond %{HTTP} !=on
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
I got this error:
Too many redirects occurred trying to open www.blankpage.com .
How Does HTTPS Redirection Work? In the Domains interface in cPanel (Home >> Domains), there's an option to enable Force HTTPS Redirection from the insecure version (HTTP) to the secure version (HTTPS) with a toggle switch.
You want to check that HTTPS is on:
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
And if it is on (%{HTTPS} on
), redirect to http://
. There is no mod_rewrite variable called %{HTTP}
, only %{HTTPS}
which can be "on" or "off".
The reason why you were getting the too many redirects error is because:
RewriteCond %{HTTP} !=on
is always true no matter if the request is http or https, since the variable doesn't exist, it will never be equal to "on". Therefore, even if the request is http, you keep getting redirected to the same URL (http).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With