HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=27)
-   -   Enabling SSL redirects to the first website using SSL (http://www.howtoforge.com/forums/showthread.php?t=59817)

sjswarts 3rd December 2012 10:03

(SOLVED) Enabling SSL redirects to the first website using SSL
 
Debian 6 Squeeze - ISPConfig 3 - Postfix, Dovecot, Apache2, Bind, Horde 5

G'day guys,

I have multiple websites hosted on this VPS. Now I have never had an issue due to nobody ever wanted SSL access on their website. They do now.

For example I have the following:

example.com
example.com.au

http://example.com goes to the right folder
https://example.com goes to the same

http://example.com.au goes to a different but right folder
https://example.com.au goes to https://example.com

Now I'm sure that its something to do with mod_rewrite but where I don't even know where to start looking.

Any help is GREATLY appreciated

till 3rd December 2012 10:35

The ssl protocol is IP based, so if you share the IP address of a sll site with other non ssl sites, all requests to thes other sites were redirected to the ssl site. So this is normal and not a issue with mod_rewrite.

There are two options:

1) Use a dedicated (different) IP address for the ssl site.

b) Add rewrite rules to the ssl vhost that redirect all https requests that are not for the sl site to the http version of the domain were the requests are for. I dont have a redirect code for this at hand, but I guess you should be able to find one with google or maybe someone else has one already and can post it here.

sjswarts 3rd December 2012 10:42

Thanks for the response Till,

So with anyone who hosts on a VPS they need to purchase an external IP for each domain that uses SSL?

As for the rewrite would have to be added to the default website? In ISPConfig?

What is the best practice here? Purchase separate IP's?

till 3rd December 2012 10:47

Quote:

So with anyone who hosts on a VPS they need to purchase an external IP for each domain that uses SSL?
Yes, thats part of the "standard" ssl specification, so its not specific to ispconfig. ISPCOnfig supports also SSL with SNI which is basically a shared ssl for namebased vhosts, but sni works only with latest web browsers, especially older Internet Exploerer versions cause problems. To prevent the above if you would use sbi would require to add a default ssl host similar to the default vhost for http.

Quote:

As for the rewrite would have to be added to the default website? In ISPConfig?
It has to be added in the website which has ssl enabled.

Quote:

What is the best practice here? Purchase separate IP's?
The easiest and cleanest solution wold be to purchase a separate IP address for the ssl site. But the other approach with the rewrite rules might work as well for you, I guess it mostly depends on the prices for IP addresses that you get charged.

till 3rd December 2012 10:47

Quote:

So with anyone who hosts on a VPS they need to purchase an external IP for each domain that uses SSL?
Yes, thats part of the "standard" ssl specification, so its not specific to ispconfig. ISPConfig supports also SSL with SNI which is basically a shared ssl for namebased vhosts, but sni works only with latest web browsers, especially older Internet Exploerer versions cause problems. To prevent the above if you would use sni would require to add a default ssl host similar to the default vhost for http.

Quote:

As for the rewrite would have to be added to the default website? In ISPConfig?
It has to be added in the website which has ssl enabled.

Quote:

What is the best practice here? Purchase separate IP's?
The easiest and cleanest solution wold be to purchase a separate IP address for the ssl site. But the other approach with the rewrite rules might work as well for you, I guess it mostly depends on the prices for IP addresses that you get charged.

sjswarts 4th December 2012 03:20

Is there a way to mark threads as solved ?? this will help people searching the forums.


All times are GMT +2. The time now is 22:02.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.