RewriteEngine on
RewriteCond %{HTTP_REFERER} !baidu.com [NC]
RewriteCond %{HTTP_REFERER} !google.com [NC]
RewriteCond %{HTTP_REFERER} !xxx.net [NC]
RewriteRule .*\.(gif|jpg)$ /band.txt [NC,L]
xxx.net是您自己的域名
band.txt是被盗链后的提示文件
win系统添加到httpd.conf
linux系统添加到.htaccess