tags:

views:

23

answers:

1

I have a site that is hotlinking images, please help

<img src="http://mattdunlap.org/?ak_action=api_record_view&amp;id=1060&amp;type=feed" alt="">

Since it is not an image (jpg|png|gif), my hotlinking script is not working

I've tried this but doesn't work

RewriteCond %{HTTP_REFERER} !^http://(www\.)?cheaps1.info/.*$ [NC]    
RewriteRule \.(feed)$ http://www.mattdunlap.org/images/dick.gif [R,L]

I've also thought about using the PHP gd library on my index page with a conditional $_GET, but would like to do everything with .htaccess

A: 
RewriteCond %{HTTP_REFERER} !^http://(www\.)?cheaps1.info/.*$ [NC]
RewriteCond %{QUERY_STRING} feed$
RewriteRule ^/$ http://www.mattdunlap.org/images/dick.gif [R,L]

The first operand of RewriteRule does not include the query string. You have to use %{QUERY_STRING}, %{REQUEST_URI} or similar.

Artefacto
Sorry, but it just isn't working... I was able to do a normal hotlink protection for jpg, gif, or png, but since this does not have a file extension, hotlinking doesn't work
Matt
@Matt I'd forgotten to remove the dot before. Also, if this is in a .htaccess the rewriterule should be changed to ^$ in order to match the root of the website.
Artefacto