apache urlrewrite防盗链功能配置
更新时间:2009年06月01日 01:14:15 作者:
配置虚拟主机时,在配置文件中加入如下内容
DocumentRoot /home/img
ServerName img.host.com
ErrorDocument 404 /
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://img.host.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.host.com/.*$ [NC]
RewriteRule \.(gif|jpg|jpeg)$ http://img.host.com/forbidden.png [R,L]
ServerName img.host.com
ErrorDocument 404 /
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://img.host.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.host.com/.*$ [NC]
RewriteRule \.(gif|jpg|jpeg)$ http://img.host.com/forbidden.png [R,L]
相关文章
详解CentOS升级Python2.6到Python2.7并安装pip
本篇文章主要介绍了CentOS升级Python2.6到Python2.7并安装pip,具有一定的参考价值,感兴趣的小伙伴们可以参考一下。2017-03-03
Linux安装Jenkins步骤及各种问题解决(页面访问初始化密码)
这篇文章主要介绍了Linux安装Jenkins步骤及各种问题页面访问初始化密码,需要的朋友可以参考下2019-12-12


最新评论