iRule switch confusion (Version 9.4.4)
So I've created an iRule using the switch statement, but for some reason my logic is failing for every conceivable match. Every condition falls through to the default case. What am I doing wrong? Thanks in advance.
New iRule to protect website storefronts from mischief
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/storefront/"} {
Do nothing
} else {
switch {[HTTP::uri]} {
"" -
"/" -
"/storefront" { HTTP::respond 301 Location "https://[HTTP::host]/storefront/home.ep" }
"/us.website-sitemap.xml" -
"/uk.website-sitemap.xml" -
"/ca.website-sitemap.xml" -
"/ie.website-sitemap.xml" -
"/au.website-sitemap.xml" -
"/row.website-sitemap.xml" -
"/robots.txt" {}
default { HTTP::respond 301 Location "https://[HTTP::host]/storefront/error.ep?errorCode=404" }
}
}
}