Using the irule below.Instead of the client getting a blank page, I’d like to redirect them or dispay a 403 page error. Where in this irule would I add that. Uswhen HTTP_REQUEST {
if { ( [string tolower [HTTP::uri]] starts_with “/books” ) } { if { not ( [IP::addr [IP::client_addr] equals “55.66.77.88”] ) or not ( [IP::addr [IP::client_addr] equals “66.77.88.99”] or not ( [IP::addr [IP::client_addr] equals “77.88.99.10”] ) } { HTTP::redirect “https://[HTTP::host]/” } } }
If the client uri starts with /books, but is not from one of these 3 ip’s then they are denied access to page. currently they get a white blank page. We would like the browser to return a 403 page error. So Here is the logic…
So far looks to be working for //mystore.com clients, we are waiting for /books src ip’s to test. Currently if client is //mystore/books and not the src IP’s, they get a blank page, that’s good but would like the 403 page.
when HTTP_REQUEST {
if { ( [string tolower [HTTP::uri]] starts_with “/books” ) } { if { not ( [IP::addr [IP::client_addr] equals “55.66.77.88”] ) or not ( [IP::addr [IP::client_addr] equals “66.77.88.99”] or not ( [IP::addr [IP::client_addr] equals “77.88.99.10”] ) } { HTTP::redirect “https://[HTTP::host]/” } } }