Mixed Content Page: requested an insecure stylesheet error

前端 未结 6 1200
死守一世寂寞
死守一世寂寞 2020-12-29 03:59

I have a website working on it. when i open any page with http:// protocol, every thing is loaded correctly, but when i try to load the page with https protocol, the page lo

相关标签:
6条回答
  • 2020-12-29 04:06

    If you are able to serve CSS etc over HTTPS, the best solution is to use // as the scheme for asset URLs.

    That means "use the same scheme (sometimes called protocol) as the parent document", i.e. use https if the page uses https. For example:

    <link rel="stylesheet" href="//mysite.com/styles.css">
    <script src="//mysite.com/app.js"></script>
    
    0 讨论(0)
  • 2020-12-29 04:06

    Experienced similar error in Drupal 8.0.1

    Error - Mixed Content: The page at '' was loaded over HTTPS, but requested an insecure stylesheet ''. This request has been blocked; the content must be served over HTTPS.

    Solution - Open .htaccess file and add the following line Header always set Content-Security-Policy "upgrade-insecure-requests;"

    0 讨论(0)
  • 2020-12-29 04:17

    Here's your problem:

    RewriteCond %{SERVER_PORT} ^443$
    RewriteRule (.*) http://www.example.com/$1 
    

    You don't allow SSL requests (443 port number is used for HTTPS requests). Try removing these lines.

    0 讨论(0)
  • 2020-12-29 04:17

    I used cloudflare's plugin as described in their guide here.

    0 讨论(0)
  • 2020-12-29 04:17

    You may also need to check your WordPress Address (URL) and Site Address (URL) under General Settings and make sure your URLs are https://www.yourdomain.com

    0 讨论(0)
  • 2020-12-29 04:26

    Most probably inside your html code you have something like

    <link href="http://someSite.com/css/someStyle.css" rel="stylesheet" type="text/css" />
    

    you should change this to

    <link href="https://someSite.com/css/someStyle.css" rel="stylesheet" type="text/css" />
    

    also the page you are referring to is .html not css, but i guess that is a typo ...

    0 讨论(0)
提交回复
热议问题