Forum Discussion
Shawn_Salyers_8
Nimbostratus
Apr 27, 2011URI 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 follow...
hoolio
Cirrostratus
Apr 27, 2011You can change from HTTP::uri to HTTP::respond 301 Location $new_location. If you're using string map to dynamically set the new location, you can use this:
http://devcentral.f5.com/wiki/default.aspx/iRules/http__respond
HTTP::respond 301 Location [string map {/idea-ub/sections/the-world/videos /videos} [HTTP::path]][HTTP::query]
Also, you could use a switch statement to more efficiently check the requested URI:
http://devcentral.f5.com/wiki/default.aspx/iRules/switch
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
