Forum Discussion
Gerald_Meese
Cirrus
May 22, 2018HTTP::redirect loop
Hello,
I'm trying to write a small iRule to create redirects to specific paths on an internal server based on the presence/absence of the 'order' parameter in the requested URI :
when HTTP_REQUE...
youssef1
Cumulonimbus
May 22, 2018Hi Gerald,
Your Irule is not correct because it will trigged to each request. either at condition "if" or in each case at "else".
when HTTP_REQUEST {
if { [HTTP::uri] contains "order" } {
HTTP::redirect /Login.aspx?guestlogin=1&order=[URI::query [HTTP::uri] order]&context=3 }
else {
HTTP::redirect /Login.aspx?guestlogin=1 }
}
You need to add an additional condition on else like this:
when HTTP_REQUEST {
if { [HTTP::uri] contains "order" } {
HTTP::redirect /Login.aspx?guestlogin=1&order=[URI::query [HTTP::uri] order]&context=3 }
elseif {[HTTP::uri] eq "/"} {
HTTP::redirect /Login.aspx?guestlogin=1 }
}
le me now if it's clear...
Regards
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects