Forum Discussion
Thiyagu
Cirrus
Dec 15, 2020Irule help to block HTTP request if the HTTP Referer header value is null or with wrong domain
Hello Team, I'm in need of an Irule to block HTTP request if the HTTP Referer header value is null or with wrong domain address. Could you please help with an irule for this request? ...
Dec 15, 2020
Hi Thiyagu,
* character is not wildcard in here.
Can you try that?
if {($referer ne "") && !($referer contains ".abc.com")}- ThiyaguDec 17, 2020
Cirrus
Hello aaa,
I have tried the below irule and it is not working. As far I know the the flow logic is correct and for some reason this irule is not working.
Could you please correct me if I' missing something here?
when HTTP_REQUEST
{
set referer [string tolower [HTTP::header value "Referer"]]
if {($referer ne "") && !($referer contains ".abc.com")}
{
HTTP::respond 400 content "Bad Request" "Content-Type" "text/html"
}
}
Regards,
Thiyagu
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
