Forum Discussion
Johan_Van_Geste
Nimbostratus
Apr 12, 2006URL Rewrite/Redirect
Dear All,
we currently have a customer that would like to do the following with iRules: an application-server is listening on http://server/app/ for requests. We'd like to have end-users connecting to http://server and end up on the /app/ page without the end-users having to input this portion.
Is this something that can easily be realised through iRules?
Thanks for your help,
Johan.
- You can use the "HTTP::uri" command to change the uri that is sent to the backend server. It's easy to change the uri, but it's the side cases that you'll want to account for. This iRule will convert "http://server/" into "http://server/app/" but will not do it for "http://server/foo".
when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { HTTP::uri "/app/" } }
when HTTP_REQUEST { if { ! [HTTP::uri] starts_with "/app" } { set olduri [HTTP::uri] HTTP::uri "/app$olduri" } }
- Johan_Van_Geste
Nimbostratus
Thanks Joe, these things did the trick in an easy way ...
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