繁体   English   中英

在Joomla 3.x中从HTTPS重定向到HTTP

[英]Redirect from HTTPS to HTTP in Joomla 3.x

我有一个可以很好地用作HTTP和HTTPS的网站。 现在,我想将HTTPS重定向到HTTP。 我将重写规则放入.htaccess文件中:

RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}

但这不起作用。 在我的index.php文件中,我将代码如下:

<?php 

if ($_SERVER['HTTPS'] == "on") {
$url = "http://mysite.pl/pl/";
header("Location: $url");
exit;
} 

?>

这也不起作用。 请帮我该怎么办? 谢谢。

尝试使用.htaccess:

RewriteCond %{HTTPS} on  
RewriteCond %{REQUEST_URI} !protected [NC]
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [L,R=301]


来源: https : //www.yellowwebmonkey.com/developer-blog/item/all-the-joomla-htaccess-redirects-you-will-ever-need

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM