Forum Discussion

Michael_-_Harr1's avatar
Michael_-_Harr1
Icon for Nimbostratus rankNimbostratus
Feb 12, 2014

How would I create I rule for HTTPS client redirect

URL client does get request https://branches.test.org/webapp/rest/public/redirect/android

 

redirect to https://play.google.com/store/apps/details?id=org.penfed.mobile.banking

 

3 Replies

  • Arie's avatar
    Arie
    Icon for Altostratus rankAltostratus

    What version are you on? Before 11.4 you could use an HTTP Class (Local Traffic ›› Profiles : Protocol : HTTP Class). If you're on 11.4 you can use a Local Traffic Policy.

     

    You could also use an iRule:

     

    when HTTP_REQUEST {
    
        if { [string tolower [HTTP::path]] starts_with "/webapp/rest/public/redirect/android" } {
    
            HTTP::respond 302 Location "https://play.google.com/store/apps/details?id=org.penfed.mobile.banking"
    
        }
    
    }
    

    Note that I used "starts_with". This may or may not work in your case (depending an whether any other paths start with "/webapp/rest/public/redirect/android"). However, "starts_with" does get around other issues that often plague redirects (e.g. trailing slashes, inclusion of default file names (like index.html)).

     

  • Arie's avatar
    Arie
    Icon for Altostratus rankAltostratus
    Michael, if it worked can you vote up the answer?