在 Apache 中防止盗版的可落地方案
总体思路与边界
Apache 层访问控制与防盗链
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?yourdomain\.com [NC]
RewriteRule \.(jpg|jpeg|png|gif|mp4|pdf)$ - [F,L]
<RequireAny>
Require ip 203.0.113.0/24
Require ip 198.51.100.10
</RequireAny>
媒体内容与 WAF 强化
SecRule REQUEST_FILENAME "\.(jpg|jpeg|png|gif)$" \
"id:1000001,phase:2,deny,status:403,log,msg:'Blocked hotlink-like access to images'"
运维与合规要点