![](/img/trans.png)
[英]Redirect all URLs starting with a substring to a new url in Joomla 3.x
[英]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示例(安全性)
嘗試使用.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.