Forum Discussion
hooleylist
Jul 03, 2009Cirrostratus
I assume the application won't redirect the client back to /something/index.htm. How about this then:
when HTTP_REQUEST {
Check if request ends with /index.htm
if {[HTTP::path] ends_with "/index.htm"}{
HTTP::respond 301 Location "[string map {/index.htm ""} [HTTP::uri]]"
log local0. "Redirecting to [string map {/index.htm ""} [HTTP::uri]]"
}
}
Note that RFC2616 states the Location header value must be a fully qualified domain name, but browsers accept a local URI. You may want to hardcode the protocol and domain in the iRule.
Aaron