Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of Weaving Dream DEDECMS to prevent Pictures from being stolen

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail about the dream weaving DEDECMS anti-picture stolen chain method, Xiaobian think it is quite practical, so share it for everyone to make a reference, I hope you can gain something after reading this article.

How does dream weaving DEDECMS prevent pictures from being stolen?

Modify.htaccess

First of all, this method is suitable for users who use Apache to set up the server, if you use IIS to set up, this method does not work.

First explain the picture anti-theft chain and turn:

What is the use of anti-theft chain?

Prevent other websites from stealing your pictures and wasting your valuable traffic.

What's the point of turning pictures?

If your website is mainly based on pictures, and one day you find that the traffic is running out before the end of the month, you can use the picture to turn, without modifying the web page, to turn the picture download request to other spaces (such as trial host), temporary transition.

Let's start with the explanation below. For example, if your pictures are all in the img directory, then put a file named.htaccess in the directory, and the contents are as follows:

RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ [NC] RewriteCond %{HTTP_REFERER} ! dedemao.com [NC] RewriteCond %{HTTP_REFERER} ! google.com [NC] RewriteCond %{HTTP_REFERER} ! baidu.com [NC] RewriteRule . (jpg|gif|png|bmp|swf|jpeg) /image/replace.gif [R,NC,L] RewriteRule ^(.*)$ http:\/\/www.dedemao.com\/image\/$1 [L]

Explain roughly:

RewriteCond %{HTTP_REFERER} !^$ [NC] RewriteCond %{HTTP_REFERER} ! dedemao.com [NC] RewriteCond %{HTTP_REFERER} ! google.com [NC] RewriteCond %{HTTP_REFERER} ! baidu.com [NC]

This part is to determine whether to steal the link, if the above conditions are true (that is, the request to visit the image, neither directly input URL, nor from dedemao.com, nor from google.com, nor from baidu.com), then execute the following turn:

RewriteRule . (jpg|gif|png|bmp|swf|jpeg) /image/replace.gif [R,NC,L]

This means that all pages with jpg, gif, png, bmp, swf, jpeg files in the stolen img directory will be replaced with images in the image directory. Note that the replacement displayed image should not be placed under the img directory of the anti-theft chain. If it is determined according to the above rules that the image request is not stolen, perform the following turn:

RewriteRule ^(.*)$ http:\/\/www.dedemao.com\/image\/$1 [L]

This means that all requests under the img directory are directed to the target server. For example, if the original url of an image is http://www.dedemao.com/img/girl.jpg, it will now go to www.example.com. http://www.de.com/image/girl.jpg Of course, you have to copy all the files under the img directory of the original server to the image directory of the temporary server before you can really use it.

About the dream weaving DEDECMS anti-picture stolen chain method to share here, I hope the above content can have some help for everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report