0

I need all requests to go to https://example.com which I have SSL cert for. My alias example.ch redirect to the example.com by

<IfModule mod_rewrite.c>
     RewriteEngine On
     RewriteCond %{HTTP_HOST} ^example.ch$ [OR]
     RewriteCond %{HTTP_HOST} ^www.example.ch$
     RewriteRule (.*)$ http://www.example.com/$1 [R=301,L]
</IfModule>

But it does not work if I put https://example.ch. Chrome drops the warning message (Your connection is not private). Is there a way to overcome this warning and smoothly redirect?

Ive tried to add

RewriteCond %{SERVER_PORT} ^443$ [OR]
RewriteCond %{HTTPS} =on

but it didnt work.

shtyler
  • 71
  • 1
  • 7
  • _Is there a way to overcome this warning and smoothly redirect?_ yes. Also get a valid cert for `example.ch`. That is your **ONLY** option. – Panama Jack Dec 14 '15 at 18:04
  • Possible duplicate of [How to redirect HTTPS requests to HTTP without a certificate (Apache VirtualHosts)](http://stackoverflow.com/questions/32143210/how-to-redirect-https-requests-to-http-without-a-certificate-apache-virtualhost) – Panama Jack Dec 14 '15 at 18:08
  • Thanks for the answer, what would be the best cert for such purpose (just redirecting)? – shtyler Dec 15 '15 at 18:26

0 Answers0