Not my ideal solution as it requires me to modify any iRule that my robots.txt rule will be in front of. That is, the robots.txt rule remains
when HTTP_REQUEST {
if { [HTTP::uri] == "/robots.txt" } {
HTTP::respond 200 content [ifile get robots.txt]
}
}
and my second rule (in this case the gopher rule) becomes:
when HTTP_REQUEST {
if { [HTTP::has_responded] } { return }
if { [HTTP::uri] == "/gopher.jpg" } {
HTTP::respond 200 content [ifile get gopher.jpg]
}
}
Or is there a way to do this entirely in the robots rule?