iRule redirection with URI caveat
Hi DevCentral. iRule noob here, trying to tackle what I think is probably a very simple request. There's two parts, the first of which should allow anything to https://.../exshortcut to go through. The second, anything else coming in on port 80 or 443, will go to https://.../search. I've cobbled together the following, but the redirect doesn't seem to execute when coming in on 443:
when HTTP_REQUEST {
if { ([HTTP::uri] starts_with "/exshortcut") } {
HTTP::uri "[HTTP::uri]"
}
else {
HTTP::redirect "https://10.110.66.34/search"
}
}
Is there anything simple I'm overlooking? Also, if I do get the redirect to /search working, will it break functionality for all other URIs after the initial redirect? For instance, if I get a successful redirect to https://10.110.66.34/search and try to head on over to https://10.110.66.34/search/abc123, will I be looped right back to /search? Any feedback is appreciated. Thanks, all!