Forum Discussion
Tony_105617
Nimbostratus
Apr 18, 2013need a rewrite or redirect rule for URI
I have only done a little iRule scripting so any thing would be helpful.
I have a customer that wants to have a iRule that will rewrite the uri portion of a request.
here's what the...
Kevin_Stewart
Employee
Apr 18, 2013Changing the incoming URI request, without causing a redirect, it pretty straight forward with the HTTP::uri command. Here's an example:
when HTTP_REQUEST {
if { not ( [string tolower [HTTP::uri]] starts_with "/addeduri" ) } {
HTTP::uri "/addeduri[HTTP::uri]"
}
}
This will cause any incoming URI request, even "/", to have the "/addeduri" string bolted to the front of it.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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