For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

tempsuli's avatar
tempsuli
Icon for Altostratus rankAltostratus
Dec 17, 2020
Solved

Redirect iRule problem

Hello,

 

I would need to do the following with an iRule. Any ideas are appreciated! Basically I need to know how to retrieve the original host in the request and add it to the end in the redirect.

 

https://www.abc.com/xxx redirected to -> www.xyz.com/portal/dsds?=https://www.abc.com/xxx

 

Thanks

 

Teemu

  • when HTTP_REQUEST {
    	HTTP::redirect https://www.xyz.com/portal/dsds?=https://[HTTP::host][HTTP::uri]
    	# OR:
    	# HTTP::respond 301 Location https://www.xyz.com/portal/dsds?=https://[HTTP::host][HTTP::uri]
    }

    Also, you can achieve the same with a local traffic policy.

3 Replies

  • when HTTP_REQUEST {
    	HTTP::redirect https://www.xyz.com/portal/dsds?=https://[HTTP::host][HTTP::uri]
    	# OR:
    	# HTTP::respond 301 Location https://www.xyz.com/portal/dsds?=https://[HTTP::host][HTTP::uri]
    }

    Also, you can achieve the same with a local traffic policy.

    • jaikumar_f5's avatar
      jaikumar_f5
      Icon for Noctilucent rankNoctilucent

       

       

      Please mark the thread as solution provided if its resolved.