Forum Discussion
ronniep_79067
Nov 17, 2009Nimbostratus
when 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.