Forum Discussion
Mike_Graston_10
Nimbostratus
Jan 26, 2007Adding a uri if one doesn't exist
Currently I have a url split between several pools depending on uri portion. How would I modify the Irule to insert a uri if none is present?Any help would be appreciated...
when HTTP_REQUES...
Colin_Walker_12
Jan 26, 2007Historic F5 Account
Unless I'm mis-interpreting the request, the HTTP::respond command isn't going to produce the desired results. The HTTP::respond command is going to send a response to the client, whereas I believe what xf6svrb is looking for is to modify the client's originally requested URI, if it's empty, to contain "ghi". Is that correct?
If so, you'd want logic something like this:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/abc"} {
pool mywebsite.com-abc
} elseif { [string tolower [HTTP::uri]] starts_with "/def"} {
pool mywebsite.com-def
} else {
if { [string length [HTTP::uri] < 2] } {
HTTP::uri "/ghi/"
}
pool mywebsite.com-ghi
}
}
HTH,
Colin
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