Forum Discussion
ckteur
Cirrus
May 21, 2021Irule or policy to URL rewrite
Hello, I need to rewrite URL with policy but doesn't work; maye will be usefull with an irule but I don't know how mahe it ... My policy: What I want with policy or Irule: ...
ckteur
Cirrus
May 25, 2021Thanks Sanjay.
Actually I need to modify the host (it's ok in your iRule: client.u.test.com
--> other.u.test.com) but also the path after the first "/" --> client.u.test.com/up is rewrited other.u.test.com/down
- spalandeMay 25, 2021
Nacreous
okay. You can use below
when HTTP_REQUEST { set uri [string tolower [HTTP::uri]] switch -glob [string tolower [HTTP::host]] { "client.u.test.com" { if {$uri starts_with "/up" } { HTTP::header replace "Host" "other.u.test.com" HTTP::uri /[join [lreplace [split [string trimleft [HTTP::uri] /] /] 0 0 "down"] /] pool Pool_other.u.test.com_1443 return } } default { return } } }
- ckteurMay 25, 2021
Cirrus
I haven't been able to test yet, I will do it tomorrow...
I forgot to say that the rewrite must allow all the possibilities behind "/down"
like "other.u.test.com/down/*"
Thanks for help
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