服务器之家:专注于VPS、云服务器配置技术及软件下载分享
分类导航

云服务器|WEB服务器|FTP服务器|邮件服务器|虚拟主机|服务器安全|DNS服务器|服务器知识|Nginx|IIS|Tomcat|

服务器之家 - 服务器技术 - WEB服务器 - apache urlrewrite防盗链功能配置

apache urlrewrite防盗链功能配置

2021-08-25 17:56服务器技术网 WEB服务器

本文主要为大家介绍apache urlrewrite防盗链功能配置方法,有需要的朋友可以参考下

配置虚拟主机时,在配置文件中加入如下内容

  1. DocumentRoot /home/img  
  2. ServerName img.host.com  
  3. ErrorDocument 404 /  
  4. RewriteEngine on  
  5. RewriteCond %{HTTP_REFERER} !^$  
  6. RewriteCond %{HTTP_REFERER} !^http://img.host.com/.*$ [NC]  
  7. RewriteCond %{HTTP_REFERER} !^http://www.host.com/.*$ [NC]  
  8. RewriteRule \.(gif|jpg|jpeg)$ http://img.host.com/forbidden.png [R,L]  

 

延伸 · 阅读

精彩推荐