We recently changed our domain name and bought a new SSL certificate. We've been unable to find a way to redirect users pointing to our old secure address to the new one without having the browser message popup with a warning about the domain mismatch. If they click "Ok" to proceed, the url rewriting logic functions as it should. Is there a way to redirect them before it even tries to send the cert? Any other workaround to this? Here's the rewrite code...
<VirtualHost _default_:443>
TransferLog /var/log/apache/access_log
SSLLogFile /var/log/apache/ssl_log
ErrorLog /var/log/apache/ssl_error_log
# General setup for the virtual host
DocumentRoot /home/html
<Directory "/home/html">
AllowOverride AuthConfig FileInfo Limit
Options +IncludesNOEXEC
AddHandler server-parsed .html .htm
</Directory>
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on
# SSL Cipher Suite:
RewriteEngine on
# For Name Change
RewriteCond %{SERVER_NAME} ^.*[old_domain]\.com.*$ [NC]
RewriteRule ^/(.*)$ https:\/\/www\.[new_domain]\.com%{SCRIPT_FILENAME} [R,L]
<VirtualHost _default_:443>
TransferLog /var/log/apache/access_log
SSLLogFile /var/log/apache/ssl_log
ErrorLog /var/log/apache/ssl_error_log
# General setup for the virtual host
DocumentRoot /home/html
<Directory "/home/html">
AllowOverride AuthConfig FileInfo Limit
Options +IncludesNOEXEC
AddHandler server-parsed .html .htm
</Directory>
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on
# SSL Cipher Suite:
RewriteEngine on
# For Name Change
RewriteCond %{SERVER_NAME} ^.*[old_domain]\.com.*$ [NC]
RewriteRule ^/(.*)$ https:\/\/www\.[new_domain]\.com%{SCRIPT_FILENAME} [R,L]