Welcome Guest | Login

https: redirecting to the wrong domain - shared/virtual hosting

I have 2 rails projects, two domains say... a.com and b.com

Both are hosted under one plan, all on one server.

a.com is my primary site (the one I opened the account for).  I bought a cert for it (under the name a.com).https://a.comhttp://a.comhttp://www.a.com
all of these work wonderfully. No problem

Along comes b.com.  Simple site, no ssl needed at all.
http://b.comhttp://www.b.com
work fine.  but...https://b.com redirects to https://a.com

If I ask for https://b.com I would expect b.com, not a.com...

What's up?  How do I ensure the https://*.b.com wind up at b.com?


Thanks,

Eric

I'm

2008-12-01 09:27 PM

Eric
SSL certificates are bound to specific IPs and there can be only one SSL certificate installed per IP. In this case, SSL certificate for your main domain is installed on your account's dedicated IP.  Whenever a request comes to this IP on port 443(https port), it will be redirected to your main domain's virtual host entry for SSL. All the domains under your account is pointed to your dedicated IP and when you access your addon domains over https, it will be redirected to the SSL vhost of your main domain , regardless of the domain name you have entered in the browser.

2008-12-02 12:43 AM

If I understand correctly there is no way around this?  Can I set up a mod_rewrite rule to redirect someone who type inhttps://b.com  
(recalling that this winds up redirecting to https://a.com)
back to http://b.com

Would that be a rewrite rule in a.com's .htaccess?

Thanks


2008-12-02 08:20 AM

Eric
Yes..I believe there is no work around for this.

Regarding the rewrite rule. Once you browse using "https" protocol. It triggers a search for the Vhost entries (in web config file) associated with the dedicated IP (the one assigned to your b.com domain). Here the IP is shared between 'a.com' and 'b.com'. So it assumes 'a.com' (since there is Vhost entries associated with port 443) and loads the same in your web browser. So your .htaccess entries wont take affect here.

2008-12-02 12:42 PM

Regards,
Rahul

Hello Guest! In order to post you must be an active client with us, please log in or sign up today!