.htaccess » WordPress mixed content error: This request has been blocked; the content must be served over HTTPS

WordPress mixed content error: This request has been blocked; the content must be served over HTTPS

For the WordPress mixed content error: “This request has been blocked; the content must be served over HTTPS” the best solution is to search&replace all links in files and the database using Regex with WP CLI.

But if you are looking for a quick fix, just add the following code to .htaccess file to automatically forward links to all external resources from http:// links to https://

RewriteEngine On
RewriteCond %{HTTPS} !on

RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [L,QSA,NE]

Header set Content-Security-Policy "upgrade-insecure-requests;"
image 31 - WordPress mixed content error: This request has been blocked; the content must be served over HTTPS
See also  How to fix curl error 60: SSL certificate problem: certificate has expired error ✅

Was this post helpful?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.

Recommended