说明:本文来自网络
位置一般情况下在 /usr/local/apache/conf/httpd.conf
或者apache 2.2 的 /usr/local/apache2/conf/extra/httpd-vhost.conf
添加
SetEnvIfNoCase Referer "^http://www.ccvita.com" local_ref
SetEnvIfNoCase Referer "^http://ccvita.com" local_refSetEnvIfNoCase Referer "^$" local_ref
Order Allow,Deny
Allow from env=local_ref
还一种写法,是用正则的,这种写法在各个版本的apache比较通用。
写法是
SetEnvIfNoCase Referer "^http://.*\.yourdomin\.com" local_ref
SetEnvIfNoCase Referer ".*\.yourdomin\.com" local_ref
SetEnvIfNoCase Referer "^$" local_ref
Order Allow,Deny
Allow from env=local_ref
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/qianling3439/archive/2009/02/05/3864248.aspx
位置一般情况下在 /usr/local/apache/conf/httpd.conf
或者apache 2.2 的 /usr/local/apache2/conf/extra/httpd-vhost.conf
添加
SetEnvIfNoCase Referer "^http://www.ccvita.com" local_ref
SetEnvIfNoCase Referer "^http://ccvita.com" local_refSetEnvIfNoCase Referer "^$" local_ref
Order Allow,Deny
Allow from env=local_ref
还一种写法,是用正则的,这种写法在各个版本的apache比较通用。
写法是
SetEnvIfNoCase Referer "^http://.*\.yourdomin\.com" local_ref
SetEnvIfNoCase Referer ".*\.yourdomin\.com" local_ref
SetEnvIfNoCase Referer "^$" local_ref
Order Allow,Deny
Allow from env=local_ref
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/qianling3439/archive/2009/02/05/3864248.aspx
0
重定向实现防盗链
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$ # %{HTTP_REFERER}服务器变量引用
RewriteCond %{HTTP_REFERER} !^http://www.aaaaa.com/.*$ [NC] //NC是忽略大小写
RewriteRule \.(mp3|jpg)$ http://www.qq.com [R=301,L] //R是redirect L是link
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$ # %{HTTP_REFERER}服务器变量引用
RewriteCond %{HTTP_REFERER} !^http://www.aaaaa.com/.*$ [NC] //NC是忽略大小写
RewriteRule \.(mp3|jpg)$ http://www.qq.com [R=301,L] //R是redirect L是link
0
本帖最后由 visaqiuqiu 于 2016-1-19 22:17 编辑
配置文件 /usr/local/apache2/conf/extra/httpd-vhosts.confhttp://www.test.com/static/image/common/logo.png
配置文件 /usr/local/apache2/conf/extra/httpd-vhosts.confhttp://www.test.com/static/image/common/logo.png
编辑回复