简体   繁体   中英

How can I redirect HTTPS to HTTP in .htaccess for specific domains?

We host a number of websites on our server. Our main site, let's call www.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.

I've wondering how I can redirect all these in the htaccess - please help!

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]

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.

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