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_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 {
pool mywebsite.com-ghi
}
}
Now if it request comes in with just the url domain name and does not have a /* after it I want to add the /ghi/ to it?
Sort of stumped but does appear to seem it would be too difficult to do????
11 Replies
Sort By
- Rico
Cirrus
Mike,
In your 'else' statement, change it to and 'elseif' and simply add a uri rewrite to change the uri to what you want.
Example:
elseif {([string tolower [HTTP::uri]] eq "/") or ([string tolower [HTTP::uri]] eq "")} { pool mywebsite.com-ghi HTTP::uri "/ghi/" }
Hope this helps.
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