Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 关于SSL重定向_Apache_.htaccess_Ssl_Mod Rewrite - Fatal编程技术网

Apache 关于SSL重定向

Apache 关于SSL重定向,apache,.htaccess,ssl,mod-rewrite,Apache,.htaccess,Ssl,Mod Rewrite,我已经安装了SSL。浏览器中的“我的网站”也会重定向到https://但在加载时,它会显示一秒钟的安全连接,然后显示“您与此网站的连接不安全”。它的url中仍然有https://。 我的htaccess文件如下 <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{R

我已经安装了SSL。浏览器中的“我的网站”也会重定向到https://但在加载时,它会显示一秒钟的安全连接,然后显示“您与此网站的连接不安全”。它的url中仍然有https://。 我的htaccess文件如下

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteEngine On 
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
重新启动发动机
重写条件%{HTTPS}关闭
重写规则^(.*)$https://%{HTTP_HOST}%{REQUEST_URI}[L,R=301]

通常情况下,如果使用https访问任何站点,但主页包含非安全链接(即与http的链接),则会显示警告


为了验证,您可以使用该工具,该工具显示任何页面上有多少链接是不安全的。

您的证书是否链接到vhost,证书上的域是否与您访问的url相同?@HugoRegibo谢谢,现在它链接到vhost了。现在的问题是,它只在主页上显示“连接不安全”,但在另一个页面上显示“安全”。我有几个带有src属性http://的图像,所以现在它工作正常@Elizabeth Anderson谢谢。如果@Elizabeth Anderson的答案有助于解决问题,请将其设置为“正确/已解决”。