Forum Discussion
Redirect pool + path
Hello,
I need to create iRule where redirect to pool + /path.
- jaikumar_f5
Noctilucent
Can you give us your complete requirement, as in when to redirect to a particular pool and to a URI. How many URL's/FQDN are involved, under what condition to which pool ?
- tamiranashvili_
Nimbostratus
I have pool with one node that listens port 8888,
and I need to create iRule for example: simple.com to redirect my pool + "/test"
result must be simple.com/test
this doesn't work
when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "simple.com" } { pool "/Common/my_pool" + "/test"
- jaikumar_f5
Noctilucent
Are you saying that your webservers will process the request only when there's /test path in the URI, when the client misses it out in the original request. Do you want this to be transparent in the client's browser. More like a URI mapping.
Or are you talking a simple redirection here.
- tamiranashvili_
Nimbostratus
I think transparent but can you give me both irules and than I test them and will choose one of them.
- jaikumar_f5
Noctilucent
PFB,
Redirect one
when HTTP_REQUEST { if { [HTTP::host] equals "simple.com" && [HTTP::uri] starts_with "/test" } { pool my_pool } else { HTTP::redirect https://[HTTP::host]/test[HTTP::uri] } }
Transparent, updating the URI and sending it to the backend member.
when HTTP_REQUEST { if { [HTTP::host] equals "simple.com" && [HTTP::uri] equals "/" } HTTP::uri [string map {"/" "/test/"} [HTTP::uri]] }
Recent Discussions
Related Content
* 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