Forum Discussion
Hello,
So in fact you have to redirect user only when the request URI is different frome the uri in your DG, so try this irule:
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
set uri [string tolower [HTTP::uri]]
if { [ class match $host equals CC-Host-to-URI-Redirect-DG ] } {
set new_URI [ class match -value $host equals CC-Host-to-URI-Redirect-DG ]
if {!($uri starts_with $new_URI)}{
HTTP::redirect "https://[getfield $host ":" 1]$new_URI"
}
}
}
Additional important point, If you use different POOl by hostname or URI, don't forget to set an OneConnect profile in order to detach http request.
let me know if you need more details.
regards
- jba3126May 28, 2019Cirrus
All, Thank you for the replies and apologies for the delayed response. It was a long weekend and I'm still trying to get used to the new DevCentral.
With that said, I see what you mean about the two match conditions. Also with setting both the HOST and URI. Unfortunately I'm still getting a loop condition when trying the iRule suggested above and matching the plain / prior to redirecting. To rule out caching of the condition I started running Chrome in Incognito mode. I also did attach the default OneConnect profile and that see to work but then I started looping when trying the other URL. Another issue I encountered is if I pasted the full URL it kicked me back to the default which is fine on the initial connection, but don't want that to happen if someone clicks on a link within the page.
Use case:
Detect host and redirect to specific URI defined in a datagroup. In short I want to be able to use one VS to host multiple specific instances of the same application that are defined with content specific to the URI. I'm going to work on adding logging and use Fiddler to see if I can catch where the loop is.
Regards,
/jeff