Forum Discussion
http redirect irule
John, I still can't see when are removing the complete log statement line, the iRule stops to work. But, if you are just trying to run "[substr [HTTP::uri] 7]" on this line, it's really wrong thing. You need to store back on HTTP::uri.
HTTP::uri [substr [HTTP::uri] 7]
pool testlab
This way, on client side the URI should be:
/abcdef/api/
, and on server side, the URI should be: /api/
Anyway, If you are facing issue when you do strip to uri value, and the traffic have an unexpected redirection because of the irule 1 execution, you can try to set priority to this irule. This way, it will execute before the iRule that you are rewriting the uri. e.g.
irule 1
when HTTP_REQUEST priority 300 {
if { [HTTP::host] contains "testlab.john.com" and [HTTP::uri] starts_with "/api/" }
{
HTTP::redirect "https://f5.com[HTTP::uri]"
}
}
irule 2
when HTTP_REQUEST {
if { [HTTP::host] contains "testlab.john.com" and [HTTP::uri] starts_with "/abcdef/api/" } {
HTTP::uri [substr [HTTP::uri] 7]
pool testlab
}
}
I think I have no more ideas to this.
Respectfully.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