Reputation: 269
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?
Upvotes: 0
Views: 2410
Reputation: 1
Change the homepage name!!! I had similar problem - homepage not looking right missing images / modules. I (logged in)went into the template - homepage settings changed homepage to a completely different page with same modules and with different name , saved that setting and logged out, then viewed the new page on the browser(whilst logged out). The new page displayed correctly then (logged in )reset the homepage back to original and logged out and checked on browser. The original page now looked correct. So it is to do with cache(database , browser or otherwise) I think although I refreshed database etc the browser or database was referring to a previous version cached and not displaying the page correctly.
This is probably because my site was being developed and I was building and testing the page continuously (same thing on my mobile phone it was not displaying because I was also testing on that too). The homepage switch fixed that as well.
You could rename the page and that would trick/force the browsers/database to rewrite the final version which is basically what I did. I also tested on another computer prior and had noted similar problem even though the page had not even be loaded which leads me to believe that by switching between pages helped rewrite the data files correctly on the server end.
Upvotes: 0
Reputation: 269
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.
Upvotes: 1