Forum Discussion

Wil_Schultz_101's avatar
Wil_Schultz_101
Icon for Nimbostratus rankNimbostratus
Jun 28, 2006

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

3 Replies

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

     

     

    http://devcentral.f5.com/Default.aspx?tabid=28&forumid=16&postid=7828&view=topic

     

     

    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...