开发者

need .htaccess rewrite rule for hot linking images

开发者 https://www.devze.com 2023-01-05 00:58 出处:网络
I have a site that is hotlinking images, please help <img src=\"http://mattdunlap.org/?ak_action=api_record_view&id=1060&type=feed\" alt=\"\">

I have a site that is hotlinking images, please help

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

Since it is not an image (jpg|png|gif), my hotli开发者_运维问答nking 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消