We have a client server hosting our web application using Apache 2.2 & Tomcat 6 in RHEL. I have setup apache re-write rule for http to https redirection and it works fine. We have two DNS names that are used to access the same application. Test1.com [Old Domain] and Test2.com[New Domain]. I want all the users trying to access [test1.com...] or https://test1.com to https://test2.com. As mentioned, [test1.com...] to https://test2.com redirection is working fine. I am not able to implement https://test1.com to https://test2.com.
We have a valid certificate for 2nd domain, but not the 1st domain. So when a user try to access using 1st domain, a security warning is displayed. I want the user to be redirected to 2nd domain before the security warning is encountered. If that's not possible, I would want to redirect the user to 2nd domain after the user clicks on "Proceed anyways".
I have tried Virtual Hosts, ServerAlias, NameVirtualHost, but nothing works. Any suggestions if we can handles this via re-write would help. Any other pointers that might lead to the resolution of this issue will be appreciated.