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
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
Oct 23, 2014Cumulonimbus
Apparently curly braces prevent string expansion in TCL?
https://devcentral.f5.com/s/feed/0D51T00006j4QMgSAM
Try
HTTP::uri [string map "[HTTP::uri] /abc[HTTP::uri]" [HTTP::uri]]
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