Forum Discussion
Redirect to new URL, but keep certain part of the original URI path.
Ok here is a strange thing and it is not working with HTTPS...
I tried the modification tonight and it works on a HTTP Virtual server, however when I tried the same iRule on an HTTPS VIP, it does not work.
Do you know what is happening? or is the URI string mapping not working with HTTPS? Is it possible the F5 can't read the URI (IAM) in the path and can't change the URI to IAM2 and redirect because of that? Do I need to do anything or consolidate the two if statement together?
The bottom one works if you direct go to https://test.abc.com/123/abc, but for some reason it does not like the matching of IAM to IAM2....what could be the issue?
Thanks for your help.
when HTTP_REQUEST {
if { [HTTP::host] equals "test.abc.com" and [HTTP::uri] starts_with "/IAM/" } {
set temp_uri [string map {/IAM/ /IAM2/} [HTTP::uri]]
HTTP::respond 307 Location "https://site1.company.com$temp_uri" }
log local0. "Host [HTTP::host] --> URI [HTTP::uri] -->Redirected"
if { [HTTP::host] equals "test.abc.com" } {
set temp_uri [HTTP::uri]
HTTP::respond 307 Location "http://site2.company.com$temp_uri"
log local0. "Host [HTTP::host] --> URI [HTTP::uri] -->Redirected"
}
}
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