Forum Discussion
ronniep_79067
Nimbostratus
Nov 17, 2009blocking or dropping particular dns requests
I have a request to see if there is a way that we can block or deny requests to www.example.com. but allow example.com. The request is to actually block anything but example.com.
...
ronniep_79067
Nimbostratus
Nov 17, 2009when HTTP_REQUEST {
if { not ([HTTP::host] equals “www.foo.com”)} {
drop
}
}
this iRule checks the host header and drops the request if hostname is not www.foo.com
you can also log, send http redirect, or do anything you want when the hostname is not matching www.foo.com
in case of not well known port number for http:
when HTTP_REQUEST {
if { not ([getfield [HTTP::host] : 1] equals “www.foo.com”)} {
drop
}
}
This iRule returns the hostname without the port number used in request.
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