iRule Errors
Hello all.. Can you please take a look at the below iRule and see why the BIGIP is giving the below errors?
First step is to see if the HTTP requested Hostname 'Exactly' matches class vanityurls
This class file contains hostnames and specific http request strings as values
if { not ([string tolower [HTTP::host]] equals [www.hallmark.com||hallmark.com]) }
{ set vanityuri [class match -value [string tolower [HTTP::host]] equals vanityurls]
if {$vanityuri ne ""} {
HTTP::redirect 301 "$vanityuri"
unset vanityuri
}
else { HTTP::redirect 301
http://www.hallmark.com/
}
}
Second step is to see if the HTTP requested 'Exactly' matches class queryurls
The query needs to be appended to the redirect
set queryyuri [class match -value [string tolower [HTTP::path]] equals queryurls]
if {$queryuri ne ""} {
HTTP::redirect 301 "$queryuri[HTTP::query]"
unset queryuri
}
Third step is to see if the HTTP requested URI 'Exactly' matches class exacturls
set exacturi [class match -value [string tolower [HTTP::path]] equals exacturls]
if {$exacturi ne ""} {
HTTP::redirect 301 "$exacturi"
unset exacturi
}
Fourth step is to see if the HTTP requested URI 'Starts with' class starturls
This step only gets executed if an 'Exact' Match and 'Contains' Match was not found
set starturi [class match -value [string tolower [HTTP::path]] starts_with startturls]
if {$starturi ne ""} {
HTTP::redirect 301 "$starturi"
unset startturi
}
Fifth step is to see if the HTTP requested URI 'Contains' matches class containsurls
This step only gets executed if an Exact Match was not found
set containturi [class match -value [string tolower [HTTP::path]] contains containurls]
if {$containuri ne ""} {
HTTP::redirect 301 "$containuri"
unset containuri
}
}