Forum Discussion

Edu_50128's avatar
Icon for Nimbostratus rankNimbostratus
Apr 06, 2011

URL redirect




I´m new in iRules...



I need to configure F5 to redirect a URL... so it is, I need to redirect the traffic for the url to, but the last one is not on my network, it´s on a web hosting (first one yes).



I´ve thought this configuration:



when HTTP request {


if { [HTTP::host] equals ""} {


HTTP: redirect ""







Will it work? What dou you think?



Is there any other configuration better?






best regards




5 Replies

  • Yes. That will work and result in a 302 Temporary Redirect.

    You can send a 301 Permanent Redirect using HTTP::respond if you prefer.

    when HTTP_REQUEST {
    if { [HTTP::host] equals "" } {
    HTTP::respond 301 Location ""
  • The [HTTP::host] portion of any URL should be auto case insensitive on any platform. Its the [HTTP::uri], [HTTP::path], or [HTTP::query] portions that are case sensitive.
  • That will teach me to skim through a post on my phone, no uri in his post ;) Thanks for the catch.



    @edu, It makes no difference if the server is local or remote, you're providing the redirect . The host will receive the redirect, lookup the new name, the authoritve name server will respond with resolved IP then host will attempt to route to that new IP.