Redirect https://alias to https://web without warning

时间:2015-12-14 18:00:55

标签: .htaccess http-redirect domain-aliasing

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.

0 个答案:

没有答案