How do I resolve mixed content errors on a subdomain after enabling Cloudflare SSL?

Responsive Ad Header

Question

Grade: Education Subject: Support
How do I resolve mixed content errors on a subdomain after enabling Cloudflare SSL?
Asked by:
83 Viewed 83 Answers

Answer (83)

Best Answer
(1099)
Mixed content errors occur when an HTTPS page tries to load resources (images, scripts, CSS) over insecure HTTP connections, causing browser warnings. To resolve this: 1. **Enable Automatic HTTPS Rewrites:** In your Cloudflare dashboard, go to 'SSL/TLS' -> 'Edge Certificates' and ensure 'Automatic HTTPS Rewrites' is enabled. This feature attempts to automatically rewrite 'http://' links to 'https://' for resources. 2. **Manually Update URLs:** If automatic rewrites miss some, inspect your subdomain's source code (HTML, CSS, JavaScript) and manually change any hardcoded 'http://' URLs to 'https://'. For CMS platforms, check theme files, plugin settings, and the database. 3. **Check External Resources:** Ensure all third-party scripts, widgets, or embedded content are also served over HTTPS. 4. **Use Relative URLs:** Employ relative URLs (e.g., `/images/logo.png`) where possible, as they adapt to the current protocol. 5. **Browser Developer Tools:** Use your browser's developer console (Console tab) to identify specific mixed content warnings and locate the problematic resources.