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.
In the processwire htaccess look for these lines
# -----------------------------------------------------------------------------------------------------------------------------------------------
If you only want to allow HTTPS, uncomment the RewriteCond and RewriteRule lines below.
# -----------------------------------------------------------------------------------------------------------------------------------------------
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
# -----------------------------------------------------------------------------------------------------------------------------------------------
If you only want to allow HTTP use the code below
# -----------------------------------------------------------------------------------------------------------------------------------------------
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [L]
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).