How to prevent image hotlinking under Apache server
Jul 25, 2016 am 08:45 AM
First explain the image hotlink protection and redirection: What is the use of image hotlink protection? Prevent other websites from stealing your images and wasting your precious traffic. What is the use of image redirection? If your website is mainly based on images, and one day you find that the traffic is almost used up before the end of the month, then you can use image redirection to redirect image download requests to other spaces (such as trial hosts) without modifying the web page. ), temporary transition. Let’s start with the explanation. For example, if your pictures are in the img directory, then put a file named .htaccess in that directory with the following content:
RewriteCond %{HTTP_REFERER} !^$ [NC]
RewriteRule .(jpg|gif|png|bmp|swf|jpeg) /image/replace.gif [R,NC,L]
RewriteRule ^(.*)$ http://image.simcole.cn/image/$1 [L]
|

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

11 Best PHP URL Shortener Scripts (Free and Premium)

Working with Flash Session Data in Laravel

Build a React App With a Laravel Back End: Part 2, React

Simplified HTTP Response Mocking in Laravel Tests

cURL in PHP: How to Use the PHP cURL Extension in REST APIs

12 Best PHP Chat Scripts on CodeCanyon
