Forum Discussion
Joe_Pipitone
Nimbostratus
Sep 09, 2013Blocking file type by referrer - redirecting afterwards
I found a great script on devcentral that allows us to prevent people from obtaining PDF's from our sites unless they are referred by one of our domains. The script integrated nicely with some custom...
hoolio
Cirrostratus
Sep 09, 2013Hi Joe,
You should be able to escape the []'s in the variable and then use subst to substitute the command with the command value.
Also, change all the variables you set in RULE_INIT to static:: to preserve CMP compatibility
http://www.tcl.tk/man/tcl8.4/TclCmd/subst.htm https://devcentral.f5.com/wiki/iRules.CMPCompatibility.ashx
when RULE_INIT {
...
set static::error_url {http://[HTTP::host]/404.aspx}
...
}
when HTTP_REQUEST {
...
HTTP::respond 302 "Location" [subst $static::error_url] Cache-Control No-Cache Pragma No-Cache
...
}
Aaron
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