iRule to redirect a URL but replace only a portion of the variable length URI??
Hi,
I'll start by saying I'm new to iRules but have been a Networking professional for many years, so please go gently on the code newbie!
There is a redirect irule that I need to create that I will eventually want to also make a call to a data group, however for the purposes of this question I just want to learn some syntax without the data group.
I have a client that is migrating sharepoint data to a newer server and wishes to redirect old user links to the new server. An example of the structure of the original URL is as follows:
http://oldsharepoint.uk/a/123/documents/doc1.doc
and the new URL to be redirect to will be:
http://newsharepoint.uk/new/documents/doc1.doc
There are over 3000 iterations of the "/a/123" portion and they are variable in length so might be "/b/1/" or "/a/1234/". I wish to match the first portion of the URI (? sorry my terminology may be off) and replace it with an equivalent.
The reason I will use a data group eventually is that these 3000 are being migrated one at a time over a period of months so I will add a container URL to the data group each time one is migrated. However the catch is that I must retain the last part of the path, so "/documents/doc1.doc" in the example above.
I'm not sure how I can match and swap out a portion of the variable length URI whilst retaining the last part!?!?
Any ideas?
Thanks.