Michael_Ozorows
Jan 24, 2018Nimbostratus
Simple switch statement for URI redirection?
Hi all,
I've fumbled around and hitting brick walls. We want this application (by default) to go to website.com/irj/portal.
If website.com/abc is typed we want a http redirect
If website.com/123 is typed we want a http redirect.
I've read switch statement is more efficient than if elseif so I'm trying to get this working. Here's what I have:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/sap/opu" {
HTTP::redirect "http://nwgtw.corp.nielsen.com/sap/bc/ui5_ui5/ui2/ushell/shells/abap/FioriLaunchpad.html"
}
"/abc" {
HTTP::redirect "http://abc.com"
}
"/123" {
HTTP::redirect "http://123.com"
}
"/xyz" {
HTTP::redirect "http://xyz.com"
}
default {
HTTP::redirect "https://website.com/irj/portal"
}
}
}
I tried removing default, tried "/" also tried "*" and all of them seem to be wanting to push this back to /xyz.com and I'm not quite sure why.
Any guidance here?