Forum Discussion
laga44_77816
Nimbostratus
Aug 07, 2008blocking content with iRules
Hi, I'm looking for a sample to block a specific
parameter from a http request URL query string.
As an example is someone hits our site with
http://test.test.11/dir/1315...
Aug 07, 2008
Sure thing. In your example "/dir/1315=bad2144" is contained in the HTTP::uri variable. If you are looking just for "bad2144" then this should work.
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] contains "bad2144" } {
drop
}
}
You could replace "drop" with a "HTTP::redirect new_url" if you want to issue a redirect.
Also, if you want to be more specific about your match or match more than one value then you can make use of a switch statement.
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
