Forum Discussion
ckteur
May 21, 2021Cirrus
Irule 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: ...
spalande
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
}
}
}
ckteur
May 25, 2021Cirrus
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