Forum Discussion

Ed_Lane_26850's avatar
Ed_Lane_26850
Icon for Nimbostratus rankNimbostratus
Mar 01, 2011

I need to redirect uri to folder of /lola and not display that in the uri.

I have the following irule and I need to redirect to the folder lola but hide it from the customers uri.

 

 

when HTTP_REQUEST {

 

if { ([HTTP::uri] equals "/guest?brand=p&studio=P&activityid=portraits")

 

or ([HTTP::uri] equals "/guestservices?brand=p&activityid=portraits")

 

or ([HTTP::uri] equals "/studio?brand=p&studio=P444&activityid=portraits")} {

 

HTTP::redirect "/lola[HTTP::uri]"

 

}

 

}

 

 

3 Replies

  • It sounds like you don't want a redirect, but actually want the append /lola to the request between the LTM and the Pool Member?

    when HTTP_REQUEST {
         switch - glob [string tolower [HTTP::uri]] {
                 "/guest?brand=p&studio=p&activityid=portraits" -
                 "/guestservices?brand=p&activityid=portraits" -
                 "/studio?brand=p&studio=p444&activityid=portraits" { 
                  HTTP::uri "/lola/[HTTP::uri]" }
              }
       }
    

  • Chris, great example as always.

     

     

    Iif you click edit and then save on your post, the HTML encoded ampersands will be reset to normal ampersands.

     

     

    Also, you can remove the space between - and glob, and set the capital P in the first and third URIs to p to make the matches work.

     

     

    Aaron
  • Posted By hoolio on 03/01/2011 03:03 PM

     

    Chris, great example as always.

     

     

    Iif you click edit and then save on your post, the HTML encoded ampersands will be reset to normal ampersands.

     

     

    Also, you can remove the space between - and glob, and set the capital P in the first and third URIs to p to make the matches work.

     

     

    Aaron

     

    Modified - Thanks for catching the upper case Ps. :) I had hoped wrapping the code in the code tags would've kept the board from screwing with the HTML but guess not.