Images won't load, even though links are correct with SSL

by linuxdanish   Last Updated March 19, 2016 08:04 AM

Well, I am utterly stumped at this point. I have a site (www.smithfieldtimes.com). It is based on joomla, and I am trying to enable HTTPS on the site. Almost all the links in the template and the links used in the articles are relative.

However for some reason the images won't display. At first I thought it was a mixed content issue, but of course I am not using hard links anywhere. I then used .htaccess to force image files to be https. So now the mixed content warning is gone, but the images still aren't showing up.

The thing is, the links aren't broken. If you right click on the images and choose "Open image in new tab" the image loads fine. Same with all the image URLs reported in firebug and Chrome dev tools.

Is there any reason that the images wouldn't load if the URLs are correct? This is what my .htaccess file looks like:

RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://smithfieldtimes.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://smithfieldtimes.com$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.smithfieldtimes.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.smithfieldtimes.com$ [NC] RewriteRule .*\.(jpg|jpeg|gif|png|bmp|pdf)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,NC,R=301]

Everything works fine on the non HTTPS site. Any suggestions or tips for even what to look for at this point would be greatly appreciated.



Answers 1


So, I actually solved it. It was something pretty basic in that I was getting too many redirect loops. I added the line "RewriteCond %{HTTPS} !=on" right before my last rewrite rule. That way it wouldn't "re-process" an HTTPS get request. A bit obvious an staring me in the nose earlier... but hey, everything seems to be working now. I am not sure if this is in fact the best/proper way, but it seems to work.

Thanks. :)

linuxdanish
linuxdanish
March 18, 2016 20:58 PM

Related Questions



Images Not Showing Up in Category View

Updated October 04, 2016 09:04 AM