Forum Discussion
shawn306_84070
Aug 17, 2011Nimbostratus
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.
http://abc.com/Environmental/Login.aspx
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" "abc.com/Environmental/Login.aspx" } }
I have not been able to get it work.
What am I missing ? Or am I totally off base.
Thanks
Shawn
- hooleylistCirrostratusIf you want to redirect, you can use this:
when HTTP_REQUEST { if {[string tolower [HTTP::host]][HTTP::uri] eq "abc.com/"}{ HTTP::redirect "http://abc.com/Environmental/Login.aspx" } }
- Kevin_Davies_40NacreousWell 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 abc.com 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 abc.com with a URI of / redirecting to http://abc.com/Environmental/Login.aspx will do what you need if you dont wish to use an iRule.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects