文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Windows下rewrite 技术实现 Apache 防盗链

Windows下rewrite 技术实现 Apache 防盗链

时间:2010-12-31  来源:秩名

apache 防盗链的第一种实现方法,可以用 rewrite 实现。首先要确认 apache 的 rewrite module 可用:能够控制 apache httpd.conf 文件的,打开 httpd.conf,确保有这么一行配置: 


 代码如下:

loadmodule rewrite_module modules/mod_rewrite.so 在找到自己网站对应的 配置的地方,加入下列代码:


 代码如下:

servername hackline.net
# 防盗链配置
rewriteengine on
rewritecond %{http_referer} !^http://hackline.net/.*$ [nc]
rewritecond %{http_referer} !^http://hackline.net$ [nc]
rewritecond %{http_referer} !^http://www.hackline.net/.*$ [nc]
rewritecond %{http_referer} !^http://www.hackline.net$ [nc]
rewritecond %{http_referer} !^http://www.baidu.com$ [nc]
rewritecond %{http_referer} !^http://www.google.com$ [nc]
rewritecond %{http_referer} !^http://www.google.com.hk$ [nc]
rewriterule .*.(gif|jpg|swf)$ http://www.hackline.net/about/nolink.png [r,nc]

 

 

标签分类:

相关阅读 更多 +
排行榜 更多 +
下载oe

下载oe

金融理财 下载
易欧app官方下载安装

易欧app官方下载安装

金融理财 下载
易欧app官方免费下载

易欧app官方免费下载

金融理财 下载