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]
您可能感兴趣的文章:
- 用ISAPI_Rewrite让IIS也支持如Apache下.htaccess的URL重写
- 给apache2.2加上mod_encoding模块後 php5.2.0 处理url出现bug
- Apache Rewrite url重定向功能的简单配置
- linux下apache开启url重写的方法(详细说明)
- Apache Rewrite实现URL的301跳转和域名跳转
- 修改apache配置文件去除thinkphp url中的index.php
- Apache+Weblogic实现URL转发
本文由 华域联盟 原创撰写:华域联盟 » apache urlrewrite防盗链功能配置
转载请保留出处和原文链接:https://www.cnhackhy.com/43569.htm