apache urlrewrite防盗链功能配置

2022-10-13,,

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

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]

《apache urlrewrite防盗链功能配置.doc》

下载本文的Word格式文档,以方便收藏与打印。