HTTP_REFERER 检查运行不正常

HTTP_REFERER 检查运行不正常

我有以下配置:

list.map
#################
http:////www.badserver.com http://www.redirectedserver.com
http:////www.badserver.com/attack.html http://www.redirectedserver.com
#################


RewriteMap phishing txt:/opt/rweb/list.map
RewriteMap lc int:tolower
RewriteCond %{HTTP_REFERER} ^https?://([^:/?]+)
RewriteCond ${lc:%1} (.+)
RewriteCond ${phishing:%1|NOT-FOUND} !=NOT-FOUND
RewriteRule ^ http://www.server.com [L]

问题是最后一个 RewriteCond 运行不佳。%1 应该只是域名,但在 list.map 中找不到它。

所以如果推荐人是http://www.badserver.com/badsite.html它还应该重定向请求。

有人可以帮我解决这个问题吗?

如果我使用 RewriteCond ${phishing:%{HTTP_REFERER}|NOT-FOUND} !=NOT-FOUND 而不是 RewriteCond ${phishing:%1|NOT-FOUND} !=NOT-FOUND 那么它就可以正常工作。

REFERER 是 www.badserver.com/attack.html,在 list.map 中列出。我只想检查 referer 的域名是否在 list.map 中列出。可以吗?

相关内容