Here's the environment:
- Apache, mod_rewrite.c exists
- WordPress
- Two domains that point to the same webhost, we'll call them
- www.olddomain.com
- www.newdomain.com
We have an SSL Certificate for www.newdomain.com, but not www.olddomain.com, as per the rules about needing two separate IPs for separate SSL certificates.
My current .htaccess file works great EXCEPT when you type in
**https**://www.olddomain.com
Then the browser throws a Privacy Error "Your connection is not private" type page.
Here's what the .htaccess looks like:
Please note that the WordPress section and the Spam Referrer section probably have nothing to do with this, but I'm including them in case they're causing problems:
Options +FollowSymLinks -MultiViews
RewriteEngine on
#
# if requested hostname is non-blank
RewriteCond %{HTTP_HOST} .
# and if requested hostname is NOT "newdomain.com"
RewriteCond %{HTTP_HOST} !^www\.newdomain\.com
# redirect to same object in correct domain
RewriteRule (.*) https://www.newdomain.com/$1 [R=301,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
##Block Spam Referrer
SetEnvIfNoCase Referer blackhatworth.com spam=yes
SetEnvIfNoCase Referer priceg.com spam=yes
Order Allow,Deny
Allow from all
Deny from env=spam