1. Assume that the link is sufficient.ImageThe host domain name of is:Www.phpcy.cn
2. Modify httpd. conf.
SetEnvIfNoCase Referer "^ http://www.phpcy.cn/" local_ref = 1
<FilesMatch ". (gif | jpg)">
Order Allow, Deny
Allow from env = local_ref
</FilesMatch>
This simple application can not only solveImage leechingA slight modification can also prevent any file leeching and downloading problems.
UseMethodWhen you link images from unspecified hosts, the images cannot be displayed. If you want to display a "leeching prohibited" image, you can use mod_rewrite.
FirstInstall ApacheThe -- enable-rewrite parameter must be added to load the mod_rewrite module.
Assume that the image of the anti-Leech feature is abc.gif. We can configure it in httpd. conf as follows:
RewriteEngine on
RewriteCond % {HTTP_REFERER }! ^ $
RewriteCond % {HTTP_REFERER }! ^ Http: // (www \.)? Test.com/. * $ [NC]
RewriteRule \. (gif | jpg) $Http://www.phpcy.cn/abc.gif[R, L]
When the host image is leeched, only the "leeching prohibited" image of abc.gif is displayed!