Mobile app version of vmapp.org
Login or Join
Jessie594

: Redirecting HTTPS to HTTP without purchasing another IP address So in the past I have always bought a new IP when working with SSL certs. I came across a client that is on a shared IP and

@Jessie594

Posted in: #Htaccess #IpAddress #SecurityCertificate #Seo

So in the past I have always bought a new IP when working with SSL certs. I came across a client that is on a shared IP and using a cert for one of the sites but not the others. So domain #1 has cert on it, and Domain #2 doesn't.

Domain #2 has things in Google indexed with HTTPS on them. I need to block HTTPS on domain #2 as it shouldn't be using it and I don't want HTTPS versions of pages appearing in Google's index.

How can I go about doing this without purchasing another IP?
Is dropping the below code into my .htaccess file a good approach?

Options +FollowSymlinks
RewriteEngine on
RewriteBase /

RewriteCond %{SERVER_PORT} ^443$ [OR]

RewriteCond %{HTTPS} =on
RewriteRule ^(.*)$ www.example.com/ [R=301,L]

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Jessie594

1 Comments

Sorted by latest first Latest Oldest Best

 

@Cofer257

That approach should work fine so long as your Apache config is setup so your application is listening on both ports 80 and 443

However, the original requests will show a warning about not have a valid SSL certificate. See the answer E Carter Young linked to in his comment if you need to avoid that.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme