iRule limits path ok, but prevents redirect from occurring
I have 2 VIPs (one internal, another is NATted to a public IP) to access a web site. The internal VIP is unrestricted, and the public VIP has an irule (below) that limits which paths can be accessed. (/testpath1) redirects (302) to (/testpath2), but only when the user is NOT logged in.
When I try to access the site internally (/testpath1), all is well, as no restrictions on the internal VIP. When I try to access the site (/testpath1) from public, I get a 404 error, I am assuming - due to the path restriction. In short, the redirect isn't occurring. I can access /testpath2 from public just fine.
When I use curl -v to access /testpath1 from public, I see the 404, but no indication of the 302 redirect.
I did verify that there are no other paths that need to be included in the irule.
I'm assuming that the irule is somehow preventing the 302 from getting to the browser, but I'm unsure how to tweak it so that the redirect can occur. I can't just add a redirect to the irule, as this should only occur when the user is not logged in to the site (the redirect is managed by the web site).
Any assistance is appreciated.
iRule:
when HTTP_REQUEST{ switch -glob -- [string tolower [HTTP::host]]{ "site.domain.com"{ if { ! ([string tolower [HTTP::path]] starts_with "/testpath1" || [string tolower [HTTP::path]] starts_with "/testpath2") }{ reject } else { pool /Common/site.domain.com_pool }
return
} }}