如何在特定域的.htaccess中将HTTPS重定向到HTTP? [英] How can I redirect HTTPS to HTTP in .htaccess for specific domains?
问题描述
我们在服务器上托管了许多网站。我们的主要网站,请致电www.domain.com。
We host a number of websites on our server. Our main site, let's call www.domain.com.
无论如何,我们注意到我们托管的其他网站等都指向https://放在我们的主网站(domain.com)之前他们的域名。问题的一部分是这些也是谷歌的索引。
Anyway, we noticed that the other sites we host, etc, all point back to our main site (domain.com) when https:// is put in front of their domain. Part of the problem is that these are indexing in Google as well.
我想知道如何在htaccess中重定向所有这些 - 请帮助!
I've wondering how I can redirect all these in the htaccess - please help!
推荐答案
将这些规则添加到www.domain.com文档根目录中的htaccess文件中,最好高于可能存在的任何其他路由规则:$>
Add these rules to the htaccess file in your www.domain.com document root, preferably above any other routing rules that may be there:
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R]
这篇关于如何在特定域的.htaccess中将HTTPS重定向到HTTP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!