Forum Discussion
SamiK_85475
Nimbostratus
Jan 09, 2011Changing the host name, part of the URI and then redirect
Hello,
I've seen lots of ideas close to what I'm trying to accomplish, but I still seem to run into problems. I hope you can help.
I'm trying catch all http requests, if the host ...
Chris_Miller
Altostratus
Jan 10, 2011I'm fairly new to string map so my apologies if this isn't the right solution.
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] contains "acb.com" } {
if { [string tolower [HTTP::uri]] starts_with "/se" } {
HTTP::redirect "http://www.xyz.com[string map {/se /sv} [HTTP::uri]]"
}
}
}
This will replace any instance of /se with /sv if both the host and uri conditions are met so it should almost certainly be more specific using "range" as you did. I'm going to quick read up on range and will hopefully update it accordingly.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