Home >php教程 >php手册 >apache rewrite 技术实现防盗链功能

apache rewrite 技术实现防盗链功能

WBOY
WBOYOriginal
2016-06-07 11:40:331003browse

apache rewrite 技术实现防盗链功能
原文地址:http://www.jb100.net/html/content-36-419-1.html
  apache 防盗链的第一种实现方法,可以用 rewrite 实现。首先要确认 apache 的 rewrite module 可用:能够控制 apache httpd.conf 文件的,打开 httpd.conf,确保有这么一行配置:

loadmodule rewrite_module modules/mod_rewrite.so

在找到自己网站对应的 配置的地方,加入下列代码:servername jb100.net<br> <br>  # 防盗链配置<br> <br> rewriteengine on<br> <br> rewritecond %{http_referer} !^http://jb100.net/.*$ [nc]<br> <br> rewritecond %{http_referer} !^http://jb100.net$ [nc]<br> <br> rewritecond %{http_referer} !^http://www.jb100.net/.*$ [nc]<br> <br> rewritecond %{http_referer} !^http://www.jb100.net$ [nc]<br> <br> rewriterule .*.(gif|jpg|swf)$ http://www.jb100.net/about/nolink.png [r,nc]原文地址:http://www.jb100.net/html/content-36-419-1.html

AD:真正免费,域名+虚机+企业邮箱=0元

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn