Hi Kevin, I think I found the problem in my iRule.
I have been trying to prevent further processing of the iRule if an event was found.
"To prevent further processing of an event in the current rule or other rules for the current TCP connection, you can use 'event EVENT_NAME disable'."
I have found with placing "event HTTP_REQUEST disable" before the "return", I was preventing even the CLIENT_ACCEPTED from being processed after the initial connection.
I had to code the "return" before the event was disabled.
Thank you for your assistance.
(I was using LTM Policies but you can't specify a 301 return code.)
Here is an example of a portion of the iRule I was processing that was failing.
when CLIENT_ACCEPTED {
set cid [clock clicks]
log local0. "\[$cid\] Troubleshooting host-Found... TCP CONNECTION!"
}
when HTTP_REQUEST {
Assign Redirect from subdomain.domain to domain_org-subdomain
log local0. "Troubleshooting host-REDIRECTS HOST [HTTP::host] PATH [HTTP::path] REFERER [HTTP::header "Referer"] "
if {[class match [string tolower [HTTP::host]] ends_with host_org_redirects]} {
set hostredirect [class match -value -- [HTTP::host] ends_with host_org_redirects]
log local0. "Troubleshooting host-FOUND MATCH $hostredirect"
HTTP::respond 301 Location $hostredirect[HTTP::uri]
PLACING THE return AFTER THE event HTTP_REQUEST disable PREVENTED THE iRule FROM BEING PROCESSED MORE THAN ONCE.
event HTTP_REQUEST disable
event HTTP_RESPONSE disable
return
}
log local0. "Troubleshooting host-REDIRECTS DONT PROCESS THIS PORTION OF THE IRULE"
}