Forum Discussion
Ravi_75522
Nimbostratus
Feb 02, 2012Problem with bots redirect
We have defined a robots class, and if any user agent matches an entry in robots class then it redirected to a pool. But the problem is that we want to redirect the traffic to different pool when the agent is googlebot and specific uri then redirect to a different pool altogether. How do we do this.
The irule for bots is as below
when HTTP_REQUEST { if { [matchclass [HTTP::header User-Agent] contains robots] } { pool NeimansBOT } }
and additional condition is that if there ia request coming from /blog (which is the URI part) and the agent is googlebot then redirect it to different pool.
Can we have the logic defined as
when HTTP_REQUEST {
if { ([matchclass [string tolower [HTTP::header User-Agent]] contains googlebot]) and ([HTTP::uri] contains "/blog")} { pool xyz }
elseif { [matchclass [HTTP::header User-Agent] contains robots] } { pool NeimansBOT } }
1 Reply
- nitass
Employee
i think the irule could be okay.
anyway, according to sol9800, the irule should select a pool under every possible condition.
sol9800: Using an iRule to load balance HTTP requests to multiple pools
http://support.f5.com/kb/en-us/solutions/public/9000/800/sol9800.html
e.g.when HTTP_REQUEST { if { ([matchclass [string tolower [HTTP::header User-Agent]] contains googlebot]) and ([HTTP::uri] contains "/blog")} { pool xyz } elseif { [matchclass [string tolower [HTTP::header User-Agent]] contains robots] } { pool NeimansBOT } else { pool default_pool } }
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