I am using the following code to try and direct my site to NON SSL but I get a redirect loop. I have tried this with .htaccess and PHP.
PHP Version
if($_SERVER["HTTPS"] == "on") {
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]);
.htaccess Version
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} =on
RewriteRule ^.*$ http://%{SERVER_NAME}%{REQUEST_URI} [R,L]
How can I do a simple redirect. “If the request is secure, send to non secure”?