Forum Discussion
Peter_Reilly
Nimbostratus
Feb 28, 2008Disallow Robots
Will the following iRule work for disallowing robots?
Thanks,
when HTTP_REQUEST {
if {[HTTP::path] eq "/robots.txt"}
{
HTTP::respond 200 content "
User-agent...
hoolio
Cirrostratus
Jan 23, 2012If you want to check for any path ending in /robots.txt, you could use:
when HTTP_REQUEST {
if {[string tolower [HTTP::path]] ends_with "/robots.txt"}{
HTTP::respond 200 content "User-agent: *\r\nDisallow: /"
}
}
But the common use is for a robot to only request /robots.txt.
http://www.robotstxt.org/robotstxt.html
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
