30-May-2023 10:35
There is an appplication changing it's url abc.com to xyz.com
the default page of the application is https://abc.com/<PATH> and it needs to be pointed to the new url https://xyz/<PATH>
https://abc.com/<PATH> -> https://xyz/<PATH>
For the same application i am also curious if we can re-direct the following SPECIFIC URL as well:
https://abc.com/ibsc/rrr/logon/login.jsp -> https://xyz.com/ibsc/qqq/Login.jsp
I'm not sure if we need to do it in 2 irules
Is the below rule correct?
when HTTP_REQUEST {
if { [HTTP::host] equals "abc.com"} {
if { [HTTP::path] equals "/<PATH>" } {
HTTP::redirect "xyz.com/<PATH>
}
if { [HTTP::host] equals "abc.com"} {
if { [HTTP::path] equals "/ibsc/rrr/logon/login.jsp" } {
HTTP::redirect " https://xyz.com/ibsc/qqq/Login.jsp"
}
}
30-May-2023 10:57 - edited 30-May-2023 10:58
@yogipd I believe the following is what you're looking for. Your first statement about abc.com changing to xyz.com seems a bit off. Did you mean to say that anything going to abc.com you want to redirect to xyz.com or is it only a specific path? Assuming the answer to my questions isn't yes, then the iRule below should work.
when HTTP_REQUEST priority 500 {
if {[HTTP::host] == "abc.com"}{
if {[string tolower [HTTP::uri]] == "/<PATH>"} {
HTTP::redirect "https://xyz.com[HTTP::uri]"
} elseif {[string tolower [HTTP::uri]] == "/ibsc/rrr/logon/login.jsp"}{
HTTP::redirect "https://xyz.com[HTTP::uri]"
}
}
}
07-Jun-2023 17:53