Forum Discussion
Pav_70755
Sep 20, 2011Nimbostratus
HTTP Re-Direct uri replace?
I have the following rule written
when HTTP_REQUEST {
if { [HTTP::uri] contains "?storyId=" } {
pool STAGE_directmarketing.thomsonnet.co.uk-80
...
hooleylist
Sep 22, 2011Cirrostratus
Here's an option which expands on Brian's examples. The iRule cannot send a 302. So if you're seeing a 302 at the client, it's most likely coming from the web application.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/win*" {
HTTP::respond 301 Location "http://www.news.com/News-Advice/[string range [HTTP::uri] 4 end]"
}
"/talk*" {
HTTP::respond 301 Location "http://www.news.com/Marketing-Services/[string range [HTTP::uri] 5 end]"
}
"/find*" {
HTTP::respond 301 Location "http://www.news.com/Business-Data/[string range [HTTP::uri] 5 end]"
}
default {
pool STAGE_www.news.comk-80
}
}
}
Aaron
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