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
...
Pav_70755
Sep 22, 2011Nimbostratus
Thanks Aaron I've managed to get the rule working as follows
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/win" or [HTTP::uri] starts_with "/Win" } {
set wininsert [string range [HTTP::uri] 4 end]
HTTP::respond 301 "location" "http://www.news.com/News-Advice$wininsert"
}
elseif { [HTTP::uri] starts_with "/talk" or [HTTP::uri] starts_with "/Talk" } {
set talkinsert [string range [HTTP::uri] 5 end]
HTTP::respond 301 "Location" "http://www.news.com/Marketing-Services$talkinsert"
}
elseif { [HTTP::uri] starts_with "/find" or [HTTP::uri] starts_with "/Find" } {
set findinsert [string range [HTTP::uri] 5 end]
HTTP::respond 301 "Location" "http://www.news.com/Business-Data$findinsert"
}
elseif { [HTTP::uri] contains "2fwusjt568" } {
pool STAGE_www.news.com-80
}
}
when HTTP_RESPONSE {
if { [HTTP::status] == 302 } {
HTTP::respond 301 Location [HTTP::header Location]
}
}
However there is a certain page which is the uri that contains "2fwusjt568" that doesnt work with the forced 301 re-direction, how can I omit this page from the if { [HTTP::status] == 302 } { part of the rule?
Thanks
Pav
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