Page 1 of 1
how to exclude certain subdomain from entire website HTTPS?
Posted: Thu Mar 10, 2016 9:57 am
by baijianpeng
My website had enabled HTTPS for entire site (SSL certificate is for *.domain.com ). But now, I need to exclude two subdomains, because those two subdomains are actually CNAME links to external resources, which do NOT allow accessing with HTTPS protocol.
How can I exclude those two subdomains from SSL when entire website had enabled HTTPS?
Thank you.
Re: how to exclude certain subdomain from entire website HTTPS?
Posted: Fri Mar 11, 2016 10:05 am
by Elizine
Please try the following code -
Code: Select all
RewriteRule (.*) https://www.mydomain.com$1 [R=301,L]
Re: how to exclude certain subdomain from entire website HTTPS?
Posted: Fri Mar 11, 2016 10:42 am
by baijianpeng
I need to use HTTPS for ALL my URLs except:
Code: Select all
image.mydomain.com
file.mydomain.com
Your rewrite rule does not work.
Thank you.
Re: how to exclude certain subdomain from entire website HTTPS?
Posted: Fri Mar 11, 2016 1:53 pm
by tjebbeke
When you add the web domains image.mydomain.com and file.mydomain.com don't enable ssl/https.
Re: how to exclude certain subdomain from entire website HTTPS?
Posted: Fri Mar 11, 2016 11:46 pm
by baijianpeng
When I tried to add new web record in VestaCP, there is no input box for subdomains. And, the IP address is fixed, I can not input other IP address.
But, my subdomain image.mydomain.com was linked to other IP address via CNAME record on my domain registration account.
Do you really understood my situation here?
Thank you.
Re: how to exclude certain subdomain from entire website HTTPS?
Posted: Sat Mar 12, 2016 9:30 am
by tjebbeke
Subdomains are added similar to normal domains. It's normal that only the IP's assigned to your server are visible when you add your 'web domain'. If you add only your main domain and enable your SSL certificate, only that domain can be accessed over SSL.