Multiple URIs redirect to single URL
Dear Community Experts,
I need multiple URIs to be redirected to single URL. Please share iRule that will accomplish this requirement.
Following three URIs need to be redirected to https://abcdef.com
1: "en/good/morning.aspx"
2: "en/good/evening.aspx"
3: "en/good/night.aspx"
I already have an iRule which successfully redirects one URI to single URL, which is shown below.
===============
when HTTP_REQUEST {
if { [HTTP::uri] contains "en/good/morning.aspx" } {
HTTP::redirect "https://abcdef.com"
}
}
==============
Instead of creating three iRules and assigning to virtual server I need one iRule to be created & assigned to virtual server.
Kind Regards
There are multiple ways to achieve it but would suggest you to add two more conditions in existing iRule.
when HTTP_REQUEST { if { ([HTTP::uri] contains "en/good/morning.aspx") || ([HTTP::uri] contains "en/good/evening.aspx") || ([HTTP::uri] contains "en/good/night.aspx") } { HTTP::redirect "https://abcdef.com" } }
Cheers...