Hotlink prevention part deux
My previous post about preventing image hotlinking works. Works well, very well. Too well actually. What I totally didn’t think about was FeedBurner, Google image search and Google cache. Since I use the Google version of FeedBurner I don’t have to add feedburner.com to .htaccess, but you might want to add it. So here’s the addition for the control file:
RewriteCond %{HTTP_REFERER} !feedburner\.com [NC]
RewriteCond %{HTTP_REFERER} !google\. [NC]
RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
I’m not sure why that last line is there, since it should all be covered by the google line, but all sites I found about the subject have it. Do they all copy information from eachother? I think I’ll try without and see what the cache looks like. To make life easy for all of you, here the complete .htaccess about the subject:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !nightspirit\.nl [NC]
RewriteCond %{HTTP_REFERER} !feedburner\.com [NC]
RewriteCond %{HTTP_REFERER} !google\. [NC]
RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
RewriteRule \.(jpg|jpeg|png|gif|bmp)$ wp-content/hotlink.gif [L,NC]
Again, edit to fit your server and image ofcourse.
Social Media