Forum Discussion
Jim_Carlberg_98
Nimbostratus
Nov 08, 2012Command is not valid in current event context
I have an IP subnet in meeting_redirect-ip. If the users subnet is equat to that subnet, I want to redirect them to meet.contractor.com. If the IP address does not match, I want the request to forwa...
hoolio
Cirrostratus
Nov 09, 2012The HTTP filter haven't been hit in CLIENT_ACCEPTED so you won't be able to use HTTP commands there. You can do a check of the client IP once per connection in CLIENT_ACCEPTED and send a redirect in HTTP_REQUEST. Or you could just move the code to HTTP_REQUEST.
If you've defined the subnets in an address type data group, a bitwise comparison is done using class match.
when HTTP_REQUEST {
if { not [class match [IP::client_addr] equals meetingplace_redirect_ip] }{
HTTP::redirect "https://meet.contractor.com"
}
}
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
