Forum Discussion

shawn306_84070's avatar
Icon for Nimbostratus rankNimbostratus
Aug 17, 2011

http redirect

I would like to get some help with creating an irule. Here is the scenario.



Right now users go to a VIP using the following url.



The users are asking to be able to just type abc and have it redirect to the site.



I have tried following



when HTTP_REQUEST { if { [HTTP::host] eq "abc" } { HTTP::header replace "Host" "" } }



I have not been able to get it work.



What am I missing ? Or am I totally off base.








2 Replies

  • If you want to redirect, you can use this:

    when HTTP_REQUEST {
       if {[string tolower [HTTP::host]][HTTP::uri] eq ""}{
          HTTP::redirect ""

  • Well you see abc doesn't give you an IP address. In the browser it will try to resolve and then fail and then it will try automatically which does resolve to an IP address. Then it sends the traffic to your VIP. At that point you can add an iRule like above or a class. A class matching host with a URI of / redirecting to will do what you need if you dont wish to use an iRule.



    Kevin (Jarvil)