Forum Discussion
mtobkes_64700
Oct 23, 2014Nimbostratus
iRule - Prepend Path to URI
Hoping someone can point me in the right direction...
I need to prepend /abc to all requests to www.host.com.
I cannot use redirects.
Request:
www.host.com/testing
Needs to hit the ser...
- Oct 23, 2014
For reasons I can't explain, string map is not matching [HTTP::uri]
Since this is a simple prepend, you could do this instead
when HTTP_REQUEST { if { [HTTP::host] starts_with "www.host.com"}{ HTTP::uri "/abc[HTTP::uri]" } }
mimlo_61970
Cumulonimbus
In its simplest form, that would be
when HTTP_REQUEST {
HTTP::uri [string map {"/test" "" } [HTTP::uri]]
}
Not sure if you need to make sure it starts with /test, or only applies to some host headers or what not, but that will remove /test from the URI
Muhammad_Irfan1
Oct 24, 2014Cirrus
Great but not only I want to remove it from the URL but I want to select a pool on the basis of /test. Just like proxypass works in Apache. It decides a pool on the basis of first word in URL like http://10.50.171.8:80/test/Services..................... now VS will select a pool name TEST(or what ever) and omit the work /test from the url and send it to pool TEST.
I will be always grateful if you combine this with your last comment.
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