IIS picture anti-theft chain and file download resource anti-theft chain

Source: Internet
Author: User
The code is as follows Copy Code

Rewritecond Host: (. +)
Rewritecond Referer: (?!) http://1.*). *
Rewriterule. *. (?: gif|jpg|jpeg|png|bmp)/block.gif [I,o,n]

Exclusion of the chain of anti-theft writing, we let Baidu,google and other search engines can show My Pictures

The code is as follows Copy Code
Rewritecond Host: (. +)
Rewritecond Referer: (?!) http://1.*). *
Rewritecond Referer: (?!) http://(. *) (. baidu.com|. Google.com|. google.cn|. g.cn|. Gougou.com|. Soso.com|. Sogou.com|. Youdao.com|. Bing.com|. Yahoo.com|. yahoo.cn|. eojoo.com)). *
Rewriterule. *. (?: gif|jpg|jpeg|png|bmp)/block.gif [I,o,n]

Another way of writing

The code is as follows Copy Code
Rewritecond Host: ^ (. +) $
Rewritecond Referer: ^ (?!) http://\1.*). *$
Rewritecond Referer: ^ (?!) Http://.*.baidu.com|. *.google.com|. *googlebot.com|. *.abc.net). *). *$
Rewriterule ^ (?!) (/logo.gif|/2_files/logo_tg.gif)). *. (?: gif|jpg|jpeg|png) $/block.gif [I,o,n]

A. The www.abc.net in the third line of the above rules for your site's domain name, please make corresponding changes according to the actual situation, inside the baidu.com and google.com is to not prevent search engine spiders crawl pictures.
B. Line fourth in the/logo.gif and 2_fies/logo_tg.gif for your logo image address, the purpose is to allow others to use your logo, if you do not need to be able to remove "(?!) (/logo.gif|/2_files/logo_tg.gif)) ". Later gif jpg and so on can be modified according to the actual situation.

Remember to restart IIS, when the anti-theft chain began to work, other sites hotlinking over the request will be rejected, otherwise it is not possible OH

Tips: Some of these visits can be downloaded by software that downloads your site's resources, which require some server widgets to be implemented, which can be found on the internet and have plenty of free.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.