Forum Discussion

Ed_26015's avatar
Ed_26015
Icon for Nimbostratus rankNimbostratus
Mar 13, 2013

iRule HTTP redirect

Hello,

 

I am looking to add a redirect to a website so that everytime a user tries to go to the homepage;

 

 

www.edtest.com

 

 

they get redirected to

 

 

www.edtest.com/webtools

 

 

I don't want them to be able to view the IIS page which resides at www.edtest.com.

 

 

Can I do this with the F5 or does it just redirect everything that contains www.edtest.com to www.edtest.com/webtool and in which case causing a continuous loop?

 

 

Regards,

 

 

Ed

 

2 Replies

  • If you specify nothing at all, the request URI is always "/".

    So you'd do a simple redirect only if the URI equals "/"

    
    when HTTP_REQUEST {
       if { [HTTP::uri] equals "/" } {
          HTTP::respond 302 Location "/webtools"
       }
    }
    
  • Jnon's avatar
    Jnon
    Icon for Nimbostratus rankNimbostratus
    I always encourage the application owners to put a redirect at the web server, it seems to make more sense to me to do it at the web/ app server than process an irule for it.