不包含特定URL的热链接保护

时间:2018-01-09 14:34:55

标签: .htaccess redirect hotlinking

我们尝试添加以下热链接保护以节省带宽。

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^https://(www\.)?domain [NC]
RewriteCond %{HTTP_REFERER} !^https://(www\.)?domain.*$ [NC]
RewriteRule \.(gif|GIF|jpg|JPG|PNG|png|jpeg|JPEG|mp4|MP4|mkv|MKV|webm|WEBM|ico|ICO)$ - [F]

这很完美。现在,我们要排除URL的热链接保护admin / thumb(domain.tld / admin / thumbs / image.jpg)应该从热链接保护中排除。

我们尝试添加以下代码但不起作用。我们搜索了stackoverflow和多个论坛,但没有人帮助我们。

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^https://(www\.)?domain [NC]
RewriteCond %{HTTP_REFERER} !^https://(www\.)?domain.*$ [NC]
RewriteCond %{REQUEST_URI} !/admin/thumbs$
RewriteRule \.(gif|GIF|jpg|JPG|PNG|png|jpeg|JPEG|mp4|MP4|mkv|MKV|webm|WEBM|ico|ICO)$ - [F]

任何帮助都将不胜感激。

0 个答案:

没有答案
相关问题