Forum Discussion
Michael_Mangret
Nimbostratus
Apr 11, 2007V9 to V4 Irule conversion
Can someone please help me convert an irule from v9 to v4? I am unfamiliar with the syntax for irules on v4.
Here is the irule in v9...
when HTTP_REQUEST {
if {[string tolower [HTTP::header x-moz:] ] contains "prefetch" } {
HTTP::respond 403 content "Forbidden"}
else {set host_pool [findclass [HTTP::host] $::DSHostPoolMap " "] }
if { $host_pool ne "" } {
pool $host_pool }
}
Thanks in advance
Mike
2 Replies
- Michael_Mangret
Nimbostratus
Does anyone know if it is even possible to do this type of Irule on V4.5ptf13? - hoolio
Cirrostratus
I don't think you can send a 403 response back using an iRule in 4.x. This would be pretty straightforward in 9.x. If upgrading to 9.x isn't an option, you might try testing a rule that redirects prefetch requests to a sorry page.
Else, a better option could be to use a robots.txt entry on your site which specifies FasterFox should not prefetch for your domain:
http://fasterfox.mozdev.org/faq.html
+ I'm a webmaster, how can I prevent prefetching?
Because some websites may not have the resources available to support the enhanced prefetching feature, it may be easily blocked by webmasters.
Prior to generating any prefetching requests, Fasterfox checks for a file named "robots.txt" in your site's root directory (subdirectories are not checked). If this file contains the following 2 lines, no prefetching requests will be made to your domain:
User-agent: Fasterfox
Disallow: /
Aaron
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