ZenphotoCMS Forum
Any .htaccess experts - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Any .htaccess experts (/thread-10783.html)



Any .htaccess experts - darkufo - 28-01-2013

Hi,

I've currently got the following in my .htaccess of my zenphoto cache folder.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?spoilertv.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?fanshowcase.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?spoilertv.co.uk [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?images.spoilertv.co.uk [NC]
RewriteRule .(jpg|jpeg|png|gif)$ http://spoilertv.co.uk/images/bandwidth.png [NC,R,L]

This blocks all not allowed domained from hotlinking our cache files.

However, what I would like to do is to allow sites to be able to hotlinked our thumbnails. The thumbnail images h have this sort of filename format

filename_100_cw100_ch100_thumb.jpg
filename_100_cw100_ch100_thumb.png

So what I would like to do is to modify the above .htaccess to globally block all access with the exception of the filenames ending in thumb eg _thumb.jpg or _thumb.png

I don't have the first idea about how to write such a rule.