shawno_84086
May 30, 2007Nimbostratus
Realtional URI rewrites
I am completely new to irules and I would like some validation, or perhaps a better way to do what I want.
I am deploying a new website that uses a completely new set of URIs. All of the previous URIs do not exist on the new site, but the data is still there using a completely different uri. There are numerous links to these pages out on the web and we would like to preserve their funcitonality.
So, I have a table of begin values and end values.
eg:
OLD NEW
abc xyz
bcd wxy
and i would like them to perform as such:
www.site.com/abc > www.site.com/xyz
www.site.com/bcd > www.site.com/wxy
I have read that you can not use relational data in classes creating irules, so I am guessing that I need an irule looking like this:
when HTTP_REQUEST
{ if { [HTTP::uri] contains "/abc" } { HTTP::respond 301 Location "http://www.mydomain.com/xyz" }
{ if { [HTTP::uri] contains "/bcd" } { HTTP::respond 301 Location "http://www.mydomain.com/wxy" }
}
Let's just say I have 1000 such URLs that I need to redirect like this and I am not sure of the performance impact of such a large irule, not to mention the managability of it.
Thank you for your help!
Shawn