17-Jun-2020 09:47
I need to create a simple iRule to redirect HTTP requests going to a URL (same as the HOST name) to the full URI. Basically appending the URI to the end of the URL. For example, here are the settings:
HOST= site.domain.com
URL= site.domain.com
URI= site.domain.com/OA_HTML/main.jsp
Full URI: https://site.domain.com/OA_HTML/main.jsp
The iRule I created results in the page showing an error due to too many redirects.
when HTTP_REQUEST {
if { [HTTP::uri] contains "/"}
{ HTTP::redirect "https://site.domain.com/OA_HTML/main.jsp" }
}
How can I make this work? Any help or suggestions is greatly appreciated!
18-Jun-2020
01:57
- last edited on
24-Mar-2022
01:29
by
li-migration
,
Try below iRule. It should work as per your use case.
when HTTP_REQUEST {
HTTP::redirect "https://[getfield [HTTP::host] ":" 1]/OA_HTML/main.jsp"
}
Hope it helps!
Mayur