Forum Discussion

naladar_65658's avatar
naladar_65658
Icon for Altostratus rankAltostratus
Jan 21, 2009

URI Redirect with complex URI

Hello all,

 

 

I have been beating my head up against a wall on this one. I have read numerous posts and have tried out a ton of different methods, but I am just not having any luck on this one.

 

 

I am having a problem with a redirect that I am trying to pull off. The iRule syntax checks to be OK, but when I try to run traffic through it I get the dreaded "ERROR_CONNECTION_RESET". I am using HTTP Watch to view the traffic btw.

 

 

What I am trying to do is redirect traffic coming in for https://www2.mycompany.com/thewrongnet/pdfsonline/ & the rest of the URI

 

over to

 

https://www2.mycompany.com/thenet/ & the rest of the URI

 

 

Here is what I have so far, which may be WAY off.

 

 

when HTTP_REQUEST {

 

string tolower[HTTP::uri] starts_with ("/thewrongnet/pdfsonline/") {

 

redirect to https://www2.mycompany.com/thenet/ + substr(HTTP::uri, 24)

 

} default {

 

pool Sharepoint_Pool

 

}

 

 

Thank you all for your time!

2 Replies

  • You're missing an "if", and instead of "redirect to" you need to use the HTTP::redirect command. I would also use "else" instead of "default":

     
     when HTTP_REQUEST { 
        if { string tolower[HTTP::uri] starts_with "/thewrongnet/pdfsonline/" } { 
         HTTP::redirect https://www2.mycompany.com/thenet/ + substr(HTTP::uri, 24) 
        } else { 
        pool Sharepoint_Pool 
        } 
     }  
     

    I haven't double-checked all the brackets for syntax but that should get you going...

    Denny