开发者 | Steve85b |
---|---|
更新时间 | 2024年7月17日 09:21 |
PHP版本: | 4.6 及以上 |
WordPress版本: | 6.6 |
版权: | GPLv3 |
版权网址: | 版权信息 |
src="http://domain.com/script.js"
If you were to load this from a https page the script will not be loaded – as non-https resources are not loaded from https pages (for security reasons).
The protocol relative url would look like
src="//domain.com/script.js"
and would load if the web page was http or https.
Tipp: Check your Settings -> General page and make sure your WordPress Address and Site Address are starting with "https".
Add the following two lines in your wp-config.php above the line that says "Stop Editing Here":
define('FORCE_SSL', true); define('FORCE_SSL_ADMIN',true);
What is Mixed Content?
Mixed content occurs when initial HTML is loaded over a secure HTTPS connection, but other resources (such as images, videos, stylesheets, scripts) are loaded over an insecure HTTP connection. This is called mixed content because both HTTP and HTTPS content are being loaded to display the same page, and the initial request was secure over HTTPS. Modern browsers display warnings about this type of content to indicate to the user that this page contains insecure resources.
Note: You should always protect all of your websites with HTTPS, even if they don’t handle sensitive communications.
Example
Without Plugin:
src="http://domain.com/script01.js" src="https://domain.com/script02.js" src="//domain.com/script03.js"
With Plugin:
src="//domain.com/script01.js" src="//domain.com/script02.js" src="//domain.com/script03.js"
If using Cache Plugins
If the plugin isn't working like expected please purge/clear cache for the changes to take effect!
http-https-remover
folder to your /wp-content/plugins/
directory.If a green padlock appears, then your site is secure with no mixed content. In Chrome or Safari, there will be no padlock icon in the browser URL field with mixed content. In Firefox the padlock icon will reflect a warning with mixed content.
Change all your CDN references to load with // (this will adapt based on how the page is loaded)