Forum Discussion
Erich_Macbeth_2
Nimbostratus
Dec 01, 2016Using an iRule for a 301 redirect and replace a sub string within the URI
Hello,
I am trying to do a 301 redirect to a new URL while rewriting a sub string within the original URI on a LTM using an iRule. Here is the simplified example of what I am trying to accomplish: ...
Kevin_Stewart
Employee
Dec 01, 2016Right. I forgot to add the Location header:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/abc/efg" } {
set newuri [string map -nocase {"/abc/efg" "/123/456"} [HTTP::uri]]
HTTP::respond 301 Location "https://tuv.com${newuri}"
}
}
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