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
 
Line 4: Line 4:
  
 
'''Open .htaccess and add this line'''
 
'''Open .htaccess and add this line'''
<IfModule mod_headers.c>
+
<IfModule mod_headers.c>
 
  Header always set Content-Security-Policy "upgrade-insecure-requests;"
 
  Header always set Content-Security-Policy "upgrade-insecure-requests;"
</IfModule>
+
</IfModule>
  
 
==External Links==
 
==External Links==

Latest revision as of 15:13, 3 June 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

<IfModule mod_headers.c>
Header always set Content-Security-Policy "upgrade-insecure-requests;"
</IfModule>

External Links