Forum Discussion
Puli
Nimbostratus
May 20, 2010iRule to remove string in header and the performance impact of it
We are planning to rewrite some url paths.
Below are two things we are planning.
1. www.abc.com/foo need to go to www.abc.com/us/foo
We can do this by adding "/us to the ...
naladar_65658
Altostratus
May 21, 2010For 2 you could try something like this if you are wanting to use string map:
when HTTP_REQUEST {
if {[string tolower [HTTP::path]] starts_with "/us/foo"}{
HTTP::redirect "http://www.abc.com[string map -nocase {/us/foo /us} [HTTP::uri]]"
}
}
If you are just looking to redirect traffic going from www.abc.com/us/foo over to www.abc.com/foo then you could use a simple switch redirect like this:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri] ] {
"/us/foo*" {
HTTP::redirect "http://www.abc.com/foo"
}
}
}
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
