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 21, 2011Nimbostratus
Thanks Brian I'm getting the following error with that rule:
line 3: [invalid integer] ["/win"]
I'm essentially needing the following url
www.news.com/win/News-Archive/Marketing-News/?storyId=84494
to be replaced with
www.news.com/News-Advice/News-Archive/Marketing-News/?storyId=84494
so "win" to be replaced with "New-Advice" in the uri and also some additional ones now
"talk" to be replaced with "Marketing-Services"
"find" to be replaced with "Business-Data"
Here is the rule modified slightly
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/win" } {
set wininsert [substr [HTTP::uri] "/win" ""]
HTTP::redirect "http://www.new.com/New-Advice$wininsert"
}
elseif { [HTTP::uri] starts_with "/talk" } {
set talkinsert [substr [HTTP::uri] "/talk" ""]
HTTP::redirect "http://www.new.com/Marketing-Services$talkinsert"
}
elseif { [HTTP::uri] starts_with "/find" } {
set findinsert [substr [HTTP::uri] "/find" ""]
HTTP::redirect "http://www.new.com/New-Advice$findinsert"
}
else {
pool STAGE_www.news.com-80
}
}
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