Forum Discussion

Thiyagu_343098's avatar
Thiyagu_343098
Icon for Nimbostratus rankNimbostratus
May 29, 2018

Difference of HTTP::respond and HTTP::REDIRECT

Hi, Could you please help me to know the difference of HTTP::respond and HTTP::REDIRECT?

 

Regards, Thiyagu

 

1 Reply

  • HTTP::respond--> Generates a response to the client as if it came from the server. If the command runs on the client side, it sends the response to the client without any load balancing taking place. If the command runs on the server side, the content from the actual server is discarded and replaced with the information provided. The BIG-IP will send the response as soon as the current iRule event completes, so you cannot alter the response in other HTTP iRule events.

    HTTP::redirect --> Redirects the current HTTP request to the specified URL, or replaces the current response with a redirect to the specified URL. This command sends the redirect response to the client immediately, so you cannot invoke this command multiple times while processing a single HTTP request (or response), nor can you use any other commands that modify response heaers or content after you give this command.

    This command always sends an HTTP 302 (Temporary Redirect) status code. If you want to send a different code such as 301 (Permanent Redirect)

    Refer irule wiki for more information.

    https://devcentral.f5.com/Wiki/iRules.HTTP__redirect.ashx