Scenario:
I have 2 domains: thinkingmonkey.me & thinkingmonkey.com. Whole of the site is accessed under https. Bought a certificate from a CA with common name thinkingmonkey.me.
For http:
www.thinkingmonkey.com, thinkingmonkey.com & www.thinkingmonkey.me have a single virtual host and get redirected to https://thinkingmonkey.me using _mod_rewrite_ rules.
thinkingmonkey.me has its separate virtualhost.
Everything works fine.
Same is the case for https:
i.e. www.thinkingmonkey.com, thinkingmonkey.com & www.thinkingmonkey.com have a single virtual host and get redirected to https://thinkingmonkey.me using _mod_rewrite_ rules.
thinkingmonkey.me has its separate virtualhost.
The Problem
- Now, if https://www.thinkingmonkey.com or https://thinkingmonkey.com is accessed,
- mod_ssl acts and a TLS Handshake occurs before mod_rewrite does the rewrite to https://thinkingmonkey.me.
- Since the common name in the certificate is under thinkingmonkey.me, This Connection is Untrusted warning get show at the browser.
- Unless I complete the handshake by accepting the certificate, It will not get redirected to thinkingmonkey.me. Which is very annoying.
So,
Is there a way to access mod_rewrite before mod_ssl?
or
Do I have to buy a separate certificate to get rid of this?