Forum Discussion
robots.txt rule?
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?
Well the simple answer might be that you would just put the "if { [HTTP::has_responded] } { return }" text into the robots iRule and just put that rule after any other rules, assuming the other rules wouldn't prevent the execution of the robots iRule. But in some cases you may need to edit the others to include that statement.
Recent Discussions
Related Content
* 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