Forum Discussion
iRule problem: what is the matter whith this iRule?
It would be very helpful if you could give a quick explanation of what you're trying to accomplish.
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/necpf/vod-i1-64/cpprospect/" } {
if { [string tolower [HTTP::uri]] ends_with "/media_cpa/sfr/cpprospect/maintenence/maintenance.jpg" } {
HTTP::redirect "http://172.19.224.62:9000/media_app/sfr/cpprospect/maintenance/maintenance.jpg"
} else {
HTTP::redirect "http://172.19.224.62:9000/media_app/sfr/cpprospect/maintenance/maintenance.html"
}
}
}This section basically says, if the URI starts with "/necpf/vod-i1-64/cpprospect/" and ends with "/media_cpa/sfr/cpprospect/maintenence/maintenance.jpg", do a browser redirect to http://172.19.224.62:9000 with a new URI. This IP is an RFC 1918 internal address, so is this an internal network where users have access to this IP directly, or do you mean to pass the traffic through a BIG-IP virtual server? If the latter, an HTTP redirect causes the browser to make a request to a specified location. Given that this server is likely behind the BIG-IP and a virtual server, you'll probably want to create a pool for 172.19.224.62:9000 and use a pool statement to route the traffic:
pool maintenance_pool
HTTP::uri "/media_app/sfr/cpprospect/maintenance/maintenance.jpg"Your HTTP_RESPONSE code is a little confusing. First, as Nathan states, you cannot use HTTP::uri in this event because this information isn't part of an HTTP response. The only places you'll generally see URIs in an HTTP response is in a redirect Location header, or in the HTTP payload itself, in which case there are different approaches for evaluating each.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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