最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Chrome loading script over http on https page - Stack Overflow

programmeradmin1浏览0评论

We have absolute paths in template, i.e.:

<link rel="stylesheet" href="/media/css/ui.css?v=3" />

When I'm trying to open https page - I get following error:

[blocked] The page at 'https://{{ full_site }}/{{secure_page}}' was loaded over HTTPS, 
but ran insecure content from 'http://{{full_site }}/media/css/ui.css?v=3': 
this content should also be loaded over HTTPS.

But path https://{{full_site }}/media/css/ui.css?v=3 is available...

Tell me, why chrome trying to load content over http on https page? And how to force it to load scripts over https on relative paths?

UPD Page loads perfectly in firefox. So this is only chrome issue. All paths are relative.

We have absolute paths in template, i.e.:

<link rel="stylesheet" href="/media/css/ui.css?v=3" />

When I'm trying to open https page - I get following error:

[blocked] The page at 'https://{{ full_site }}/{{secure_page}}' was loaded over HTTPS, 
but ran insecure content from 'http://{{full_site }}/media/css/ui.css?v=3': 
this content should also be loaded over HTTPS.

But path https://{{full_site }}/media/css/ui.css?v=3 is available...

Tell me, why chrome trying to load content over http on https page? And how to force it to load scripts over https on relative paths?

UPD Page loads perfectly in firefox. So this is only chrome issue. All paths are relative.

Share Improve this question edited Dec 20, 2013 at 12:01 Nikolay Fominyh asked Dec 20, 2013 at 10:16 Nikolay FominyhNikolay Fominyh 9,2569 gold badges71 silver badges103 bronze badges 4
  • What is the absolute URI of the resource? – PeeHaa Commented Dec 20, 2013 at 10:18
  • This might be helpful to you developer.mozilla/en-US/docs/Security/MixedContent/… – Sachin Jain Commented Dec 20, 2013 at 10:19
  • Do your CSS ui.css has any url property which loads HTTP content ? – Sachin Jain Commented Dec 20, 2013 at 10:20
  • 1 possible duplicate of Chrome not honoring https in relative URLs – kapa Commented Feb 28, 2014 at 0:00
Add a ment  | 

1 Answer 1

Reset to default 4

This could be the reason that your CSS file ui.css may be referring to resources (e.g. images) via background or background-image property which is loading insecure content (Content from HTTP servers)

If you have resources on your site, use Relative Protocol Links like

url(//example./images/some_image.png)

Similarly, update your link to use relative protocol link like

<link rel="stylesheet" href="//{{full site}}/media/css/ui.css?v=3" />
发布评论

评论列表(0)

  1. 暂无评论