Brand new to iRules and need help (redirect)

I have a request from the business to find a work around to an error they have. They printed and published on the web an incorrect URL. So instead of correct the publication they would like me to correct it by redirecting them to another URL. But I have tried other redirects but not able to get it to work.

I have two requests

1. redirect from my.example.org to my.example.org/srp/app/home (this I am able to get to work just as it should.

2. redirect from my.example.org/srp/aap/home to my.example.org/srp/app/home (this one I am not able to get to work, so this is the one I need some help with)

again I am brand new to this and any help would be great.

Travis

This one from user nitass should do the trick;

when HTTP_REQUEST {
 switch [string tolower [HTTP::path]] {
  "/" -
  "/srp/aap/home" {
   HTTP::redirect "https://[HTTP::host]/srp/app/home"
      }
   }
}
}

Hi WLB,

Thanks for all of the posts lately. We and the users definitely appreciate the contributions.

Aaron

worked as needed thank you very much for the help

You’re welcome Aaron, my pleasure, I’m learning quite a bit myself. Cheers

Steve