Forum Discussion

Emiliano's avatar
Icon for Nimbostratus rankNimbostratus
Apr 25, 2023

Keep URL after a redirect

Hi Guys,

I have an iRule that perform a redirect to an external website. I need to keep the original URL when the redirect is done.


if { [string tolower [HTTP::path]] contains "/sfnetios_xp"}
HTTP::respond 301 noserver Location[HTTP::uri]



The original URL is and should be kept in the browser.



3 Replies

  • From the description you provided, it sounds like you want to do a reverse proxy of an external website (to keep the FQDN in the client's web browser address bar the same) as opposed to a redirect? Is this correct?

    If so, you will need to:

    1) Create a pool containing the public IP address (or alternatively an FQDN node) of the target website

    2) Enable SNAT to ensure that the return traffic routes back via the F5.

    3) Replace the 301 redirect in your iRule with the following:


    HTTP::header replace host ""


    In addition, if the target site you are wanting to proxy is using https:// then you would also need to add a server SSL profile to the VIP.


  • Emiliano If you are wanting to perform and HTTP redirect to an external website then you cannot do that and maintain the original HTTP host header value. You can take the original HTTP host header and put that into a new field called the referer and then the external location could configure their side to look for in the referer header and then that remote side can perform a rewrite when they receive the traffic from to 

  • Hi Paulius, thanks for your assistance. I will check the referer header options and then configure on the remote site.