apache urlrewrite防盗链功能配置
配置虚拟主机时,在配置文件中加入如下内容DocumentRoot /home/img
ServerName img.host.com
ErrorDocument 404 /
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^[ DISCUZ_CODE_1 ]nbsp;
RewriteCond %{HTTP_REFERER} !^http://img.host.com/.*$
RewriteCond %{HTTP_REFERER} !^http://www.host.com/.*$
RewriteRule \.(gif|jpg|jpeg)$ <img src="http://img.host.com/forbidden.png" border="0" alt="">
文档来源:网络转载 http://www.zzvips.com/article/186494.html
页:
[1]