Forum Discussion
Techgeeeg_28888
Nimbostratus
Aug 19, 2015Irule help needed
Hi Guys,
I have a requirement of an irule to achieve the following, will someone kindly help me out.
I have a URL http"//www.service.com/_badlink/*.pdf" i want to block this and throw a pag...
Yann_Desmarest
Cirrus
Aug 19, 2015when HTTP_REQUEST {
if {[HTTP::host] eq "[www.service.com](http://www.service.com)" and [HTTP::uri] starts_with "/_badlink/"} {
switch -glob [string tolower [HTTP::uri]] {
"*.pdf" {
set message "illegal file download !!!"
HTTP::respond 200 content [subst -nocommands -nobackslashes [ifile get message.html]] noserver "Content-Type" "text/html"
}
}
}
}
Then, you have to add an ifile containing the html content of your message. You can set $message in your content and it will be replaced by the value of the variable in irule.
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