Forum Discussion
Anil_Gupta_01_1
Nimbostratus
Oct 06, 2016http request re-write
Hi,
I need help to rewrite the http request for below requirement.Request your help. I was trying below irule; but it is not working.
Original request on F5 VIP
https://xyz.com/sme/mobile-webconsole
Need to rewrite to below URL before request send to pool member
https://xyz.com/mobile-webconsole
when HTTP_REQUEST {
if { ([HTTP::host] equals "xyz.com") and ([HTTP::path] equals "/sme/mobile-webconsole") } {
HTTP::path "/mobile-webconsole"
}
}
Regards, Anil
2 Replies
- Nazir_52641
Cirrus
Hi Anil
Try using HTTP::uri instead of HTTP::path
- VernonWells
Employee
should be fine for the rewrite, and generally, is preferred (since it maintains any request parameters). I recommend adding logging, as in:HTTP::pathwhen HTTP_REQUEST { log local0. "host = [HTTP::host]; path = [HTTP::path]" if { [string tolower [HTTP::host]] eq "xyz.com" and [HTTP::path] eq "/sme/mobile-webconsole" } { log local0. " .. matches" HTTP::path "/mobile-webconsole" } }to see what's going on.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
