Forum Discussion

Jon_Singh's avatar
Jon_Singh
Icon for Altostratus rankAltostratus
Jan 23, 2014

irule http to https redirect with a little nuance

Hi Everyone,

I was hoping for a hand, I'm working on a irule that says: if you reach http://sysdev redirect to https://sysdev.x.com/login.aspx

otherwise, if someone has a bookmark to http://sysdev/form1.aspx redirect to https://sysdev.x.com/form1.aspx

So this is what I have:

when HTTP_REQUEST {
   if { [HTTP::uri] == "/" } {
      HTTP::redirect https://sysdev.x.com/login.aspx 
   }
    else {
        HTTP::redirect https://sysdev.x.com[HTTP::uri]
    }
} 

Would this work? I cant find much documentation on 'else' only on 'elseif' - any help would be appreciated.

3 Replies

No RepliesBe the first to reply