Forum Discussion
ant77
Feb 24, 2021Cirrostratus
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"
}
}