wordpressimage

Images are not showing while you're not logged in on wordpress website


I have a Wordpress website with the following plugins:

A while ago I activated SSL on the domain. Since that moment I have had some problems with the images. I uninstalled every single plugin to see which plugin might have a negative effect on the images. But I cannot find the problem.

When I am logged in I can open the direct path to the image. When I am not logged in the site redirect me to the home page.

Does anyone have an idea what I can try to solve this problem?


Solution

  • I didn't realize that the folder 'wp-content' had its own .htaccess-file. That file had this content

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?example\.com/ [NC]
    RewriteCond %{REQUEST_URI} !hotlink\.(gif|png|jpg|doc|xls|pdf|html|htm|xlsx|docx|mp4|mov) [NC]
    RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]
    RewriteRule .*\.(gif|png|jpg|doc|xls|pdf|html|htm|xlsx|docx|mp4|mov)$ http://example.com/ [NC]
    

    I changed http to https:

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^https://(www\.)?example\.com/ [NC]
    RewriteCond %{REQUEST_URI} !hotlink\.(gif|png|jpg|doc|xls|pdf|html|htm|xlsx|docx|mp4|mov) [NC]
    RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]
    RewriteRule .*\.(gif|png|jpg|doc|xls|pdf|html|htm|xlsx|docx|mp4|mov)$ https://example.com/ [NC]
    

    This solved the problem.