Forum Discussion
Lee_Sutcliffe
Jun 26, 2018Nacreous
You could use a simple iRule like this
when HTTP_REQUEST {
if {([HTTP::uri] equals "/admin") || ([HTTP::uri] equals "/admin2")} {
if {!([IP::client_addr] equals "10.0.0.1")} {
HTTP::redirect https://mywebsite.co.uk
}
}
}
You could also use a datagroup to store your IP addresses if you plan on using more than one:
when HTTP_REQUEST {
if {([HTTP::uri] equals "/admin") || ([HTTP::uri] equals "/admin2")} {
if {!([class match [IP::client_addr] equals "my_datagroup"])} {
HTTP::redirect https://mywebsite.co.uk
}
}
}
You can take this a step further and add the URIs to a datagroup too:
when HTTP_REQUEST {
if {[class match [HTTP::uri] equals "my_uri_datagroup"]} {
if {!([class match [IP::client_addr] equals "my_ip_datagroup"])} {
HTTP::redirect https://mywebsite.co.uk
}
}
}