ReWriting a URI assitance

Hey everyone, I need a bit of help rewriting a URI…

What I have today is:

http://www1.domain.com/dir1/variable/length/URI/page.ext

What I would like to happen is for it to redirect to

http://www2.domain.com/dir2/variable/length/URI/page.ext

Both www1 and www2 are already built at different IP’s and seem to work fine… I can set up a redirect in www1 that if uri_starts with /dir1/%u to redirect it to http://www2.domain.com/dir2/%u but it seems to end up taking it to http://www2.domain.com/dir2/dir1/%u

So in the end I would like:

http://www1.domain.com/dir1/%u

-to magically turn into

http://www2.domain.com/dir2/%u

I appriciate any guidence, thanks!

Version is 4.6.4

Okay, looks like there is a thread below that helped me solve this…

Since I’m already here I may as well ask, in the string:

redirect to “https://” + http_host + “/xyz” + findstr(http_uri, “/abc”, 4)

does the ‘4’ in the findstr() function cause a deletion of 4 char’s? That’s what it would seem but thought that I should get conformation.

Thanks again,

Found the answer here:

http://tech.f5.com/home/bigip/manuals/bigip4\_5/bigip4\_5ref/BIGip\_rules.html

Sorry for taking up space…

No problem. Thanks for posting the link to the solution.

-Joe