隐藏重定向HTTP到HTTPS .htaccess的

问题描述:

我需要一个http页面重定向到一个HTTPS和隐藏它,如:隐藏重定向HTTP到HTTPS .htaccess的

http://www.example1.com - >https://www.example2.com

所以例1总是在URL栏可见,并且example2被隐藏。

会是这样的工作?如果不是,我应该改变什么?

RewriteEngine On 
RewriteCond %{REQUEST_URI} ^/index.html 
RewriteRule ^index.html https://www.example2.com [L] 
RewriteCond %{HTTPS} on 
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}