apache  urlrewrite防盗链功能配置

服务器 发布日期:2024/11/5 浏览次数:1

正在浏览:apache  urlrewrite防盗链功能配置
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]