Forum Discussion
ant77
Feb 22, 2021Cirrostratus
Redirect to new URL, but keep certain part of the original URI path.
Hi All, Can you guys help with this unique requirement? We need to match based on the URI the client comes in on (IAM), than redirect to a new URL while changing IAM to IAM2, and keeping their...
I think two if matching cause this. Can you try this?
when HTTP_REQUEST {
if { [HTTP::host] equals "test.abc.com" } {
#log local0. "Host [HTTP::host] --> URI [HTTP::uri] --> Redirected"
if { [HTTP::uri] starts_with "/IAM/" } {
HTTP::respond 307 Location "https://site1.company.com[string map {/IAM/ /IAM2/} [HTTP::uri]]"
return
}
else {
HTTP::respond 307 Location "http://site2.company.com[HTTP::uri]"
return
}
}
}
ant77
Feb 24, 2021Cirrostratus
Enes Afsin Al, Thank you so much! I will try tonight and let you know...
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