I have website which works good as HTTP and HTTPS. Now I want to redirect HTTPS to HTTP. I put rewrite rule into .htaccess file:
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}
but this doesn't work. In my index.php file i put code as below:
<?php
if ($_SERVER['HTTPS'] == "on") {
$url = "http://mysite.pl/pl/";
header("Location: $url");
exit;
}
?>
This also doesn't work. Please help me what should I do? Thank you.
You can set it in the global configuration . Also see htaccess examples (security)
Try this for .htaccess:
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !protected [NC]
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [L,R=301]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.