Forum Discussion
sundogbrew
Altocumulus
Nov 21, 2008uri redirect
Folks, I am new to irules and not a very good scripter. Was very resistant to use them and now find that I am not going to get around it. So I am looking for some help. This seems like a simple kind of thing but I couldn't find something similar enough to get it to work. I have a url
https://mydomain.com
for normal
mydomain.com/stuff/stuff/stuff I want it to forward as normal but I want it to say if the uri is /bla/bla/bla instead of /stuff/stuff/stuff redirect to a different url all together
So that is
https://mydomain.com/stuff/stuff - normal but for
https://mydomain.com/bla/bla/bla - redirect to
https://anotherguysdomain.com/bla/bla/bla
hope that makes sense.
Thanks for any help in advance!
Joe
- This should be fairly straght forward assuming you are terminating SSL on the BIG-IP. If you are not decrypting the SSL, there is no way for the iRules to look at the content.
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/bla/bla/bla*" { HTTP::redirect "https://anotherguysdomain.com[HTTP::uri]" } } }
- sundogbrew
Altocumulus
Joe, - Your example was to convert
https://mydomain.com/bla/bla/bla ->https://anotherguysdomain.com/bla/bla/bla
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects