SSL site with different domain name

What would you recommend as the best method to setup a site where the unsecured domain can be reached at http://www.example.com, but the secured site is reached via https://secure.example.com?

Obviously, this will require a dedicated IP address in order to support SSL with Apache. If I were to setup www.example.com as a virtual server, I suspect I can then setup secure.example.com as an alias for it. However, will this then cause any problems when setting up the SSL certificate for the domain?

FWIW, a couple of lines of php code at the beginning of an index.php file can be used to "redirect" the user if they go to the wrong "domain".

Status: 
Closed (fixed)

Comments

I have a very similar setup as you.

What I did is:

  1. Setup "example.com" as a Virtual Server
  2. Gave "example.com" a dedicated IP address
  3. Setup "secure.example.com" as an alias of example.com
  4. Install an SSL cert into example.com

At that point, going to https://secure.example.com works perfectly, as does plain old http://example.com.