Forum Discussion
Sukesh123456_25
Aug 23, 2018Altostratus
Adding a URI using IRULE
I want to add a URI using an irule. I saw different articles but could not find any one exactly matching my requirement.
Below is the requirement.
When I hit a VIP it should add a URI at th...
Stanislas_Piro2
Cumulonimbus
Do you want to redirect (HTTP response 302 or 307 with new URL location header) or forward with new URI.
If you want to redirect use this code (Never insert the Host header in the redirect if the protocol and the host are the same than the client request):
when HTTP_REQUEST {
don't evaluate the uri but the path (without query string)
if { [HTTP::host] equals "restricted-list" && [HTTP::path] equals "/"} {
Change only the path part, keep the query string
Use 307 instead of 302 (default redirect command) to force the client to post data if the first request was a POST.
HTTP::respond 307 Location "/prl-ws/[HTTP::uri]"
}
}
If you want to forward and change the URI in serverside request
when HTTP_REQUEST {
don't evaluate the uri but the path (without query string)
if { [HTTP::host] equals "restricted-list" && [HTTP::path] equals "/"} {
Change only the path part, keep the query string
HTTP::path "/prl-ws//"
}
}
Mohammed_Taher
Jan 23, 2023Nimbostratus
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