What, if anything, is showing up in the log files (/var/log/ltm) on the BIG-IP? The one thing that stands out is that you likely don't want the "string tolower" surrounded with two brackets. I'd try something like this:
when HTTP_REQUEST {
log local0. "client IP is [IP::client_addr]"
if { ![matchclass [IP::client_addr] equals address_datagroup] } {
if { ([string tolower [HTTP::host]] equals "thewebsite.com") and
[matchclass [string tolower [HTTP::uri]] starts_with $::xxxxxxxxxxcom_uri_datagroup] } {
HTTP::redirect "http://xxx.xxx.xxx.com"
}
}
}
If it continues to error out, check the /var/log/ltm file for the associated errors.
-Joe