Forum Discussion
SysAdmins_23367
Nimbostratus
Apr 09, 2010can't get HTTP::redirect to work
I'm attempting to make a simple iRule which will redirect a user with a defined IP address and allow everyone else who connects to the default pool. The problem is that everytime I associate the following iRule to my virtual server I get a "page cannot be displayed" error. Even if I'm connecting from an IP which is not 192.168.98.232 I still get the page cannot be displayed error. I am able to access http://192.168.30.53/index.html directly from my PC and the F5 so it's not a firewall issue. Any help would be greatly appreciated.
when HTTP_REQUEST {
if { [[IP::client_addr] equals 192.168.98.232]}
{ HTTP::redirect http://192.168.30.53/index.html }
else { forward }
}
1 Reply
- hoolio
Cirrostratus
If you check the /var/log/ltm log file, you should see runtime TCL errors indicating an invalid command of 1 or 0. If you add the IP::addr command it should work fine:when HTTP_REQUEST { if { [IP::addr [IP::client_addr] equals 192.168.98.232]}{ HTTP::redirect "http://192.168.30.53/index.html" } }
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