-1

This is my .htaccess - site does redirect to HTTPS but still gives: Your connection to the site is encrypted, but Google Chrome has detected mixed content on the page. How to avoid this? Thank you.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
</IfModule>
2
  • 1
    Edit the content of your site, you may be referecing content with absolute links e.g. <img href=http://www.example.com/image.png>
    – HBruijn
    Jan 21, 2015 at 14:05
  • Look at the source for the page, normally ctrl-U. and search for http:// That should tell you what is unencrypted. Jan 21, 2015 at 14:07

1 Answer 1

1

To add to what the above two individuals said, it may be worth your while to use relative links for anything you are hosting: "src=images/banner.jpg" instead of "src=http://example.com/images/banner.jpg"

Any offsite resources such as jquery should b eloaded over https.

But the error you are seeing is because there are resources (images/css/js) on your page that are linked via http. mod_rewrite will be unable to assist with this issue as the initial connection is still encrypted.

Not the answer you're looking for? Browse other questions tagged .