Use htaccess to request HTTPS version of images for mixed content warning in SSL

From ETCwiki
Revision as of 15:12, 3 June 2020 by Ddxfish (talk | contribs)
Jump to navigationJump to search

You are using some web host to serve your website. You added an SSL certificate and now you can get your site properly loading on HTTPS. You now notice that you have links on your site to HTTP versions of your images and downloads.

This article is to avoid having to rewrite all of your URL's in your website to serve secure versions of your content. This method does not use Rewrite's.

Open .htaccess and add this line <IfModule mod_headers.c>

Header always set Content-Security-Policy "upgrade-insecure-requests;"

</IfModule>

External Links