I actually figured it out. My mistake was not accounting for the verb (GET) at the beginning and the whatever it's called at the end (HTTP/1.1). Now it looks like this, and it works perfectly as far as I can tell:

reqirep ^([^\ ]*)\ +/string3/(.*)\ +(.*) \1\ /cgi-bin/cgi-gw.exe?id=\2&action=autodetails\ \3 if bot string3

Shawn

On 12/14/2010 11:42 AM, Shawn Heisey wrote:
I am trying to get some URL rewriting done with the following config. I've sanitized it with generic strings. It should only do the rewrite on string3 if it is coming from a bot. The request paths appear to be passing through unmodified.

It does appear that the use_backend stuff is working, but the reqirep statements aren't working. What am I doing wrong?

frontend service *:80
acl bot hdr(user-agent) -i ia_archiver jeeves googlebot mediapartners-google msnbot slurp zyborg
    acl string1      path_beg        -i /string1/
    acl string2      path_beg        -i /string2/
    acl string3      path_beg        -i /string3/

reqirep ^/string1/(.*) /cgi-bin/cgi-gw.exe?id=\1&action=webres if string1 reqirep ^/string2/(.*) /cgi-bin/cgi-gw.exe?id=\1&action=capt if string2 reqirep ^/string3/(.*) /cgi-bin/cgi-gw.exe?id=\1&action=autodetails if bot string3

    use_backend apache          if string1
    use_backend apache          if string2
    use_backend apache          if bot string3
    default_backend             tomcat

backend apache
    balance     leastconn
#    server      server8080 10.10.14.127:8080 check
    server      server8081 10.10.14.127:8081 check

backend tomcat
    balance     leastconn
    server      server8080 10.10.14.127:8080 check
    server      server8081 10.10.14.127:8081 backup check




Reply via email to