Shawn_Salyers_8
Apr 27, 2011Nimbostratus
URI Redirect with 301
Hello and thank you for the help....
I have a need to take the incoming request and replace portions of the URI and redirect to ta different pool, which is currently working with the following iRule:
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] eq "devurl.mycompany.com" } {
if { [HTTP::uri] contains "/landing/sections/innovation/article/" } {HTTP::uri [string map {/landing/sections/innovation/article /articles} [HTTP::path]][HTTP::query]}
elseif { [HTTP::uri] contains "/landing/sections/lifestyle/article/" } {HTTP::uri [string map {/landing/sections/lifestyle/article /articles} [HTTP::path]][HTTP::query]}
elseif { [HTTP::uri] contains "/landing/sections/managing/article/" } {HTTP::uri [string map {/landing/sections/managing/article /articles} [HTTP::path]][HTTP::query]}
elseif { [HTTP::uri] contains "/landing/sections/marketing/article/" } {HTTP::uri [string map {/landing/sections/marketing/article /articles} [HTTP::path]][HTTP::query]}
elseif { [HTTP::uri] contains "/landing/sections/money/article/" } {HTTP::uri [string map {/landing/sections/money/article /articles} [HTTP::path]][HTTP::query]}
elseif { [HTTP::uri] contains "/landing/sections/technology/article/" } {HTTP::uri [string map {/landing/sections/technology/article /articles} [HTTP::path]][HTTP::query]}
elseif { [HTTP::uri] contains "/landing/sections/the-world/article/" } {HTTP::uri [string map {/landing/sections/the-world/article /articles} [HTTP::path]][HTTP::query]}
elseif { [HTTP::uri] contains "/landing/sections/innovation/videos/" } {HTTP::uri [string map {/landing/sections/innovation/videos /videos} [HTTP::path]][HTTP::query]}
elseif { [HTTP::uri] contains "/landing/sections/lifestyle/videos/" } {HTTP::uri [string map {/landing/sections/lifestyle/videos /videos} [HTTP::path]][HTTP::query]}
elseif { [HTTP::uri] contains "/landing/sections/managing/videos/" } {HTTP::uri [string map {/landing/sections/managing/videos /videos} [HTTP::path]][HTTP::query]}
elseif { [HTTP::uri] contains "/landing/sections/marketing/videos/" } {HTTP::uri [string map {/landing/sections/marketing/videos /videos} [HTTP::path]][HTTP::query]}
elseif { [HTTP::uri] contains "/landing/sections/money/videos/" } {HTTP::uri [string map {/landing/sections/money/videos /videos} [HTTP::path]][HTTP::query]}
elseif { [HTTP::uri] contains "/landing/sections/technology/videos/" } {HTTP::uri [string map {/landing/sections/technology/videos /videos} [HTTP::path]][HTTP::query]}
elseif { [HTTP::uri] contains "/landing/sections/the-world/videos/" } {HTTP::uri [string map {/idea-ub/sections/the-world/videos /videos} [HTTP::path]][HTTP::query]}}
pool POOL-X001
}
What I am being asked to do now, is add a 301 to the redirect.
Any help would be greatly appreciated.
--Shawn