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
This should remove the /test and select the pool POOL_NAME
when HTTP_REQUEST {
set uri [string tolower [HTTP::uri]]
if { $uri starts_with "/test" } {
HTTP::uri [string map {"/test" "" } $uri ]
pool POOL_NAME
}
}
Muhammad_Irfan1
Oct 25, 2014Cirrus
As my URl are case sensitive so made little change
when HTTP_REQUEST {
set uri [HTTP::uri]
if { $uri starts_with "/CRM" } {
HTTP::uri [string map {"/CRM" "" } $uri ]
pool Tibco-LB-Group4
}
}
This is working for me Please check if the set statement is right? Please can you add a statement which will log all the requests to external log server for example the ip of the log server is 10.50.242.239. You made my day sir.
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