Difference between revisions of "Use htaccess to request HTTPS version of images for mixed content warning in SSL"

From ETCwiki
Jump to navigationJump to search
(Created page with "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...")
 
Line 9: Line 9:
 
*[https://help.dreamhost.com/hc/en-us/articles/215364618#content-security-policy Dreamhost htaccess stuff] - This is where I found this answer
 
*[https://help.dreamhost.com/hc/en-us/articles/215364618#content-security-policy Dreamhost htaccess stuff] - This is where I found this answer
 
*[https://stackoverflow.com/questions/35112266/whats-correct-htaccess-rule-to-redirect-mixed-content-to-https StackOverflow Content-Security-Policy] - same answer but on StackOverflow
 
*[https://stackoverflow.com/questions/35112266/whats-correct-htaccess-rule-to-redirect-mixed-content-to-https StackOverflow Content-Security-Policy] - same answer but on StackOverflow
 +
[[Category:Internet]]

Revision as of 00:32, 31 March 2020

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

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

External Links