BIG-IP Solutions: URL Redirect Deep Dive
Check out our "BIG-IP Solutions" series where we will dive into all kinds of cool features related to the BIG-IP. In this edition, I'll take a deeper look at URL redirects using policies instead of iRules.
Sometimes you just need to simply redirect one web page to another. But sometimes you have a page with lots of links and you want to redirect some of them but not all of them. What do you do then?? Fear not my friends...the BIG-IP is here to help! Check out this video where we deep dive into some URL redirects and show off the power of BIG-IP policies. Enjoy!
- Samir_Jha_52506Noctilucent
Is it possible to redirect 301?
- ltwagnonRet. Employee
Great question @f5_rock! You can't do a 301 directly with the policy, but it is possible to reuse parts of the path from the original request in the redirect by using a tcl expression in your policy like this:
"tcl:[string map {/path1/ /} [HTTP::uri]]"
You can also call an iRule from policy to do the 301. Yes, this obviates the need for a policy if that's the only function, but if your policy has more functionality than that and you want to keep all the flow logic in the policy, a combo approach is a nice option. Details for 301 redirect in a comment on this thread:
- Samir_Jha_52506Noctilucent
Thanks John for explanation.. Looks like link page has moved..
- ltwagnonRet. Employee
Hi f5_rock...sorry for the bad link...not sure what is going on with that. The link above also took me to a "page moved or removed" error message. But, when I searched for those key words on the DevCentral search page, the link showed up and I could access it. Maybe try that out. Thanks!