Mixed Content
Quick summary
Your secure (HTTPS) page is trying to load an insecure (HTTP) resource, which the browser blocks for security reasons.
Why this happens
Hardcoded
http://URLs in the HTML or JavaScriptThird-party scripts or resources served only over HTTP
Protocol-relative URLs (
//) that resolve to HTTP on an HTTP redirect
Minimal example
<script src="http://cdn.example.com/lib.js"></script><script src="https://cdn.example.com/lib.js"></script>An HTTPS page loading an HTTP script is mixed content — the browser blocks it. Use https:// so the resource loads over a secure connection.
How to diagnose
Check the browser console for mixed content warnings
Inspect blocked resources in the Network tab of DevTools
Search your codebase for
http://references that should behttps://
How to fix
Change
http://tohttps://in all resource URLsUse protocol-relative URLs (
//example.com/...) or relative pathsEnsure your CDN and third-party providers support HTTPS
How to prevent
Always use
https://for external resourcesUse relative URLs for same-origin resources
Related Resources
Related Lessons
- HTTP
Learn about HTTP and HTTPS
Related Practice
- HTTP Methods Quiz
Test your knowledge of HTTP methods and protocols.
Related Tools
- HTTP Status Codes
Reference for HTTP status codes related to mixed content.