Forum Discussion

Richard__Harlan's avatar
Richard__Harlan
Historic F5 Account
Mar 22, 2005

HTTP Redirect Question

We just installed our new 6400 with ver 9.0.4 when writeing our rules we user to doc LTM guide for GTM and it show doing HTTP redirects like so

 
 when HTTP_REQUEST {  
   if { [[HTTP::uri] matches_regex "secure"] } {  
     [HTTP::redirect "https://[HTTP::host][HTTP::uri]"]  
   }  
 } 
 

The syntax checker liked the rule just fine, now when someone hit the rule we get an error. On the Forums I see the HTTP redirect writen like

redirect to "https://[HTTP::host][HTTP::uri]"

My question is which am I to use and if the above does not work can it be changes in the docs. THanks

Richard Harlan

John Deere

3 Replies

  • drteeth_127330's avatar
    drteeth_127330
    Historic F5 Account
    Listen to the forum. There is an extra set of square brackets in the above rule.
  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    Also, you can use either "HTTP::redirect xxx" or "redirect to xxx". The newer syntax is "HTTP::redirect", but to make it easier to migrate from 4.x, we maintained some of the common 4.x commands like "redirect to".

     

     

    Sorry for the confusion. We are also in the process of correcting the documentation.