Reputation: 20016
I have two sites on my hosting account:
business.com bookgroup.com
I want business.com to always be served with https. I don't have an SSL cert for bookgroup.com so it can stay http.
My .htaccess is:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^business\.com [NC]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
and this works perfectly for business.com. It also works for bookgroup.com. But when I do
It redirects to https://www.bookgroup.com.
How do I prevent this?
Upvotes: 1
Views: 18
Reputation: 785176
This rule will only work for business.com
domain due to first RewriteCond
RewriteCond %{HTTP_HOST} ^business\.com [NC]
You may have some other rule/code doing this or it is happening due to old browser cache.
There are several ways to verify:
Upvotes: 1