Forum Discussion

JasonF03_176851's avatar
JasonF03_176851
Icon for Nimbostratus rankNimbostratus
Dec 28, 2017

iRule for url redirect for internal application.

We have users that are used to typing in to get to our help page. We are making changes and have the new help desk software behind the F5. We want them to type in and get redirected to How would I go about this if I create a new virtual server to handle this. I am not very proficient at writing iRules.

 

2 Replies

  • AndOs's avatar
    AndOs
    Icon for Cirrostratus rankCirrostratus

    Create a new iRule and use something similar to this

    when HTTP_REQUEST {
        if { [HTTP::host] equals "help" } {
            HTTP::redirect "https://url/dgg"
        }
    } 
    

    (untested, I grabbed an example from here https://devcentral.f5.com/questions/redirect-testexamplecom-to-testexamplecom-abc-def-ghi)

    Also make sure that your VIP have an HTTP profile and a client ssl profile with a valid certificate.

    If the URL that's redirected to ("url") points to the same VIP as "help", make sure that the certificate used is valid for both hostnames.

    Hope it helps.

    /Andreas

  • hi,

     

    you can try following switch rule too..

     

    when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/help" { HTTP::redirect ";}

     

    } }