Mike Cain
2006-10-27 18:16:35 UTC
Hi - there is a web site out there linking to one of our JPG files from
their web site. We've asked them to stop by they have not. Therefore we
need to stop this programmatically at the server level. (In case you are
wondering, we cannot rename or move the file to cause a 404 for them because
we need this file in this spot for others legitimately using it).
For all these unwanted requests, the referrer contains the offending parties
domain - so its easy for us to know programmatically which requests to
block - we just need to look for www.theirdomain.com in the referrer.
If this was a ASP or ASP.NET page we would do this easily from a ISAPI or
HTTPModule. From there we'd look at the referrer and if there was a match
we'd block the request. However the requested resource in this case as
mentioned is a JPG. How can we go about adding a layer of "smarts" to IIS
programmatically to block requests for this JPG based on the referrer?
Thank you for you advice.
their web site. We've asked them to stop by they have not. Therefore we
need to stop this programmatically at the server level. (In case you are
wondering, we cannot rename or move the file to cause a 404 for them because
we need this file in this spot for others legitimately using it).
For all these unwanted requests, the referrer contains the offending parties
domain - so its easy for us to know programmatically which requests to
block - we just need to look for www.theirdomain.com in the referrer.
If this was a ASP or ASP.NET page we would do this easily from a ISAPI or
HTTPModule. From there we'd look at the referrer and if there was a match
we'd block the request. However the requested resource in this case as
mentioned is a JPG. How can we go about adding a layer of "smarts" to IIS
programmatically to block requests for this JPG based on the referrer?
Thank you for you advice.