You are heading in the right direction. Your iRule just checks if there is a Referer header. If you want to restrict from a single site, you’ll have to check agains the value of the Referer header.
when HTTP_REQUEST {
if { ([HTTP::header "Referer"] ne "www.birdwatch.com") } {
HTTP::respond 200 Content "SORRY, You Can't access this page directly";
}
}
This assumes you have the “seagulls_pool” set as the default pool for the virtual. If not, then add an “else” to the if clause and do the pool assignment there.
Keep in mind that any client can manipulate the value of any HTTP header. There are many browser plugins which allow a user to do this like RefControl (Click here) or TamperData (Click here).