Forum Discussion

Brandon_High_10's avatar
Brandon_High_10
Icon for Nimbostratus rankNimbostratus
Dec 07, 2004

HTTP::redirect options

Is there a way to sent a 301 code back with HTTP::redirect? There are a few instances that we have to use 301s due to search indexes.

 

 

So far I've been using the following, but I was wondering if the HTTP::redirect has an option for return codes.

 

 

HTTP::respond 301 "Location" "http://www.foo.com/"
  • From the documentation it doesn't seem like that's possible.

     

    HTTP::redirect Redirects a HTTP request or response to the specified URL. Note that this command sends the response to the client immediately. Therefore, you cannot specify this command multiple times in an iRule, nor can you specify any other commands that modify header or content, after you specify this command.

     

    HTTP::respond [content ] [ ]+ This is a powerful API that allows users to generate or rewrite a client request or a server response. When the system runs the command on the client side, it sends the response to the client without any load balancing taking place. If the system runs the command on the server side, the content from the actual server is discarded and replaced with the information provided to this API. Note that because the system sends the response data immediately after this iRule runs, we recommend that you not run any more iRules after this API.

     

     

     

    -Joe