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 [http:uri]
And know is fine
2. www.abc.com/us/foo needs to be rewritten to www.abc.com/foo
How can i match the /us/ in the beginning ONLY and remove it as shown above?
For a site that get a peak of 100 hits/second, does this degrade performance of the site? since BigIP will look at every single hit and re-write.
Appreciate any suggestions.
thanks.
2 Replies
- naladar_65658
Altostratus
For 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]]" } }
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri] ] { "/us/foo*" { HTTP::redirect "http://www.abc.com/foo" } } }
- naladar_65658
Altostratus
I forgot to mention, if you use the switch command then the impact will be very minimal. I do not know the impact of using the string map, but I have used it on sites getting 100's of requests a minute and haven't noticed any kind of negative impact on the BIG-IP box or in using that site from a clients perspective.
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