For example, if all your images are in the img directory, place a file named. htaccess in the directory with the following content: RewriteEngineonRewriteCond % {HTTP_REFERER }! ^ $ [NC] RewriteCond % {HTTP_REFERER }! Simcole.cn [NC] RewriteCond % {HTTP_REFERER }! Zhuaxia.com [NC] RewriteCond % {
For example, if all your images are in the img directory, place a file named. htaccess in the directory with the following content: RewriteEngine on RewriteCond % {HTTP_REFERER }! ^ $ [NC] RewriteCond % {HTTP_REFERER }! Simcole.cn [NC] RewriteCond % {HTTP_REFERER }! Zhuaxia.com [NC] RewriteCond % {
For example, if all your images are in the img directory, place a file named. htaccess in the directory with the following content:
RewriteEngine on
RewriteCond % {HTTP_REFERER }! ^ $ [NC]
RewriteCond % {HTTP_REFERER }! Simcole.cn [NC]
RewriteCond % {HTTP_REFERER }! Zhuaxia.com [NC]
RewriteCond % {HTTP_REFERER }! Google.com [NC]
RewriteCond % {HTTP_REFERER }! Baidu.com [NC]
RewriteCond % {HTTP_REFERER }! Bloglines.com [NC]
RewriteRule. (jpg | gif | png | bmp | swf | jpeg)/image/replace.gif [R, NC, L]
RewriteRule ^ (. *) $ http: \/image.simcole.cn \/image \/$1 [L]
Below is a rough explanation:
RewriteCond % {HTTP_REFERER }! ^ $ [NC]
RewriteCond % {HTTP_REFERER }! Simcole.cn [NC]
RewriteCond % {HTTP_REFERER }! Zhuaxia.com [NC]
RewriteCond % {HTTP_REFERER }! Google.com [NC]
RewriteCond % {HTTP_REFERER }! Baidu.com [NC]
RewriteCond % {HTTP_REFERER }! Bloglines.com [NC]
This part is to determine whether or not to steal the chain. If the above conditions are true (that is, the request to access the image is neither directly entering the URL nor from simcole.cn, nor from zhuaxia.com or google.com, or from baidu.com or bloglines.com:
RewriteRule. (jpg | gif | png | bmp | swf | jpeg)/image/replace.gif [R, NC, L]
This means that all webpages with jpg, gif, png, bmp, swf, and jpeg files under the img directory are replaced by replace.gif images under the image directory. Note that do not place the displayed images in the img directory with anti-leech settings. If the image request is not leeching based on the above rules, perform the following redirection:
RewriteRule ^ (. *) $ http: \/image.simcole.cn \/image \/$1 [L]
It means that all the requests under the img directory are directed to the target server, for example, there is a picture that the original url is a http://web.chinaitlab.com/UploadFiles_5817/200808/20080805094642297.jpg, And now it will go to the http://image.simcole.cn/image/girl.jpg. Of course, you must copy all the files under the img directory of the original server to the image directory of the temporary server to make the switch available. The effect is to save all the traffic occupied by image downloads on the original server, so that the temporary server can afford it.
Isn't it easy? Try it ..