Forum Discussion

smund's avatar
smund
Icon for Nimbostratus rankNimbostratus
Jun 17, 2008

irule uri redirect headache

I have 2 seperate url's with uri's that I am trying to redirect a third url/uri.

 

 

I can do the one for one irule but I am stuck with doing a single irule for both.

 

 

this works:

 

when HTTP_REQUEST {

 

if {[HTTP::uri] equals {https://www.test.com:8143/iGetList.shtml}} {HTTP::uri {https://track.test.com/tally/iGetList.shtml}

 

}

 

}

 

 

this doesnt:

 

when HTTP_REQUEST {

 

if { [HTTP:8143:uri] starts_with "/iGetList.shtml" } {

 

HTTP::redirect "https://track.test.com/tally/iGetList.shtml"}

 

}

 

 

any ideas?

1 Reply

  • The second one doesn't work cause the following is invalid "HTTP:8143:uri"

    I think you might want to try the following:

     
     when HTTP_REQUEST { 
       set entirehost [HTTP::host][HTTP:uri] 
       if { $entirehost eq "www.test.com:8143/igetList.shtml" } {  
           HTTP::redirect "https://track.test.com/tally/iGetList.shtml"  
          } 
     } 
     

    or

     
      
     when HTTP_REQUEST { 
         if { HTTP::host] eq "www.test.com:8143" } { 
             if { [HTTP::uri] starts_with "/iGetList.shtml" } {  
                 HTTP::redirect "https://track.test.com/tally/iGetList.shtml"  
                } 
            } 
     } 
     

    hope this helps

    CB