iRule Recipe 1: Single URL Explicit Redirect
Series Introduction
Let's face it: there aren't many people out there who have extensive experience with Tcl. Since iRules is a Tcl dialect, that means that finding a solid iRules solution can be ...
Updated Jun 06, 2023
Version 2.0VernonWells
Employee
Joined August 23, 2012
Anthony_1648
Oct 12, 2018Nimbostratus
Thanks for the article! It was helpful, but I'm still having trouble getting an iRule to work for http redirects. If a user comes with a specific path /newpath I need it redirected to a different site, if the user does not specify the path I need it redirected to another site. This is what I have, but it's not working properly. Any help would be appreciated.
when HTTP_REQUEST { if { (([HTTP::host] equals "site.com/newpath") or ([HTTP::host] equals ";)) } { HTTP::redirect "; }
else {(([HTTP::host] equals "site.com") or ([HTTP::host] equals ";)) } HTTP::redirect "; }