Reputation: 1
I'm on a shared hosting plan having 1 main domain and 1 add-on domain. I just installed SSL certificate, however, I encountred the following problem
HTTPS on main domain works fine, but when accessing the addon domain I'm getting redirected to another site with HTTPS. I'm able to access the addon domain without HTTP but would it be possible to force HTTPS to HTTP or remove access to HTTPS for the add-on domain?
This is what I currently have in .htaccess
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Upvotes: 0
Views: 431
Reputation: 18671
Without the add-on domain. Use (instead of your code):
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !addondomain\.com$ [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Force HTTPS to HTTP for the add-on domain. Add:
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} addondomain\.com$ [NC]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Upvotes: 1