For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Shivam_84461's avatar
Shivam_84461
Icon for Nimbostratus rankNimbostratus
May 21, 2015

Problem with URL redirection

I wanted to redirect the webpages on this condition

if http://xyz.com/j/k/l redirect to www.abc.com

if http://xyz.com redirect to https://xyz.com/a/b

When I configured the irule, first part is working but not the second one. So basically when we try accessing http://xyz.com its creating a redirect loop.

My irule

when HTTP_REQUEST { if { [HTTP::uri] == "/j/k/l" } { HTTP::redirect "https://www.abc.com/" }

elseif { [HTTP::uri] == "/"  } {
    HTTP::redirect "https://xyz.com/a/b"    
}
else {
    HTTP::redirect "https://[HTTP::host][HTTP::uri]"    
}

}

Thanks Shivam

11 Replies