Search
Categories
Chống chôm link ảnh .htaccess
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
01.
