Forum Discussion

Sri1's avatar
Sri1
Icon for Nimbostratus rankNimbostratus
Mar 21, 2023

iRule not working on few machines

 

I have a problem with iRule based url redirection, just a simple to redirect host to a path like below

when HTTP_REQUEST {
if { [HTTP::host] equals "example.com"}
{
    HTTP::redirect "https://example.com/login"
}
}

I tried this as well

when HTTP_REQUEST {
if { [HTTP::uri] equals "/"}
{
    HTTP::redirect "https://[HTTP::host]/login"
}
}

Both works in redirecting the site but on few machines, few other vlan users are getting too many redirects or just the page spinning.Not sure why this works on few machines while not on others. Packet capture is not so helpful as backend on HTTPS. Please suggest.

 

 

2 Replies

  • Sri1 In order to know why you are receiving so many redirects we need a bit more information on the virtual servers that this iRule is applied to and where in your topology these users are that receive multiple redirects. If I had to guess without any of that other information most likely this iRule is also applied to the 443 virtual server or they reside in the same subnet as the destination server causing these redirects.

  • Only a hint for when you cannot properly do a traffic capture: most browsers have a 'debug' option that allow you to see each request and response in detail, which is quite nice to see what's happening on the client side.

    Both Chrome and Firefox use F12 to activate this option.

    /Mike