Forum Discussion
irule uri preservation for direct https requests
I need to preserve 3 uri but redirect all other requests. I created the following rule, which works on the http vip, but breaks the site if also applied to the https vip. What adjustment(s) am I missing?
when HTTP_REQUEST { if { ([HTTP::uri] equals "/a/b/c.asp") or ([HTTP::uri] equals "/d/e/f.txt") or ([HTTP::uri] equals "/x/y/z/") } { HTTP::redirect "https://[HTTP::host][HTTP::uri]"
} else { HTTP::redirect "https://www.mywebsite/apply" } }
2 Replies
- Hamish
Cirrocumulus
Infinite loop on the HTTPS request when accessing https://site.domain/a/b/c.asp and https://site.domain/x/y/z/ I'd guess
Don't redirect back to yourself would be the recommendation from me... Do you really think you ned it on the https VS?
H
- Stanislas_Piro2
Cumulonimbus
Hi,
If you apply this irule on HTTPS VS, it will loop for the three first URLs...
when HTTP_REQUEST { if { ([HTTP::uri] equals "/a/b/c.asp") or ([HTTP::uri] equals "/d/e/f.txt") or ([HTTP::uri] equals "/x/y/z/") } { if {[TCP::local_port] equals 443} { return } else { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } } else { HTTP::redirect "https://www.mywebsite/apply" } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com