Portfolio
My Blog
Scroll down to discover
Search
Categories

Chống chôm link ảnh .htaccess

September 23, 2011Category : IT & Network

Xài file htaccess:

<IfModule mod_rewrite.c>
2.RewriteEngine On
3.RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?domain\.com/ [NC]
4.RewriteCond %{HTTP_USER_AGENT} !(googlebot-image|msnbot|psbot|yahoo-mmcrawler) [NC]
5.RewriteRule \.(bmp|gif|jpe?g|png)$ - [NC,F]
6.</IfModule>

Với cách này thì khi site nào chôm link ảnh sẽ không thấy được ảnh

<IfModule mod_rewrite.c>
2.RewriteEngine On
3.RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?domain\.com/ [NC]
4.RewriteCond %{HTTP_USER_AGENT} !(googlebot-image|msnbot|psbot|yahoo-mmcrawler) [NC]
5.RewriteCond %{REQUEST_URI} !^/hotlink\.png$
6.RewriteRule \.(bmp|gif|jpe?g|png)$ /hotlink.png [L]
7.</IfModule>

Với cách này thì site nào chôm link ảnh sẽ thấy cái ảnh hotlink.png

Leave a Reply

Your email address will not be published. Required fields are marked *

01.
© Oliver / All rights reserved.
To top