SSL证书重定向网站到不安全

时间:2019-12-02 13:09:49

标签: html ssl ssl-certificate

因此,我试图在hostgator上发布我的网站,上传所有文件,购买SSL。但是,当我访问我的网站时,它不会重定向到安全页面。因此,我打开了.htaccess并将代码编辑为

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.altjenberberi.com/$1 [R,L]

但是除非我单击“加载不安全脚本”,否则页面将无法加载

enter image description here

,如果我单击它,会将我重定向到一个不安全的版本。

使用的大多数js脚本均已上传到项目中,并且仅在线加载Google字体 还有这个<script src="http://a.vimeocdn.com/js/froogaloop2.min.js"></script>

注意:上面照片中的错误与particles.js有关,因为我已经调用了它,但未包含在页面中。

particles.js:1495 Uncaught TypeError: Cannot read property 'getElementsByClassName' of null
    at window.particlesJS (particles.js:1495)
    at app.js:15
window.particlesJS @ particles.js:1495
(anonymous) @ app.js:15

particles.js:1495 Uncaught TypeError: Cannot read property 'getElementsByClassName' of null
    at window.particlesJS (particles.js:1495)
    at XMLHttpRequest.xhr.onreadystatechange (particles.js:1531)

编辑:使用此脚本编辑了.htaccess,因此不会出现拼写错误

    RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

编辑2:不知道为什么,但是如果我完全删除了这行代码

  <script src="http://a.vimeocdn.com/js/froogaloop2.min.js"></script>

页面拒绝加载,仅显示“正在加载”徽标。

不确定与ssl相关的bug是否有效,但是我没有在页面中调用任何脚本,但是如果脚本不在,则不会加载

1 个答案:

答案 0 :(得分:1)

浏览器无法在安全连接中加载<script src="http://...">。将这些脚本中的每一个替换为指向安全脚本的链接(例如:<script src="https://....">

还要确保没有图像通过http://加载