asp.net - Using web.config to ban user-agents -


Is it possible that some user agents have web Is restricted directly from config? Some robots do not follow robotstext, and I want to stop certain types of requests (especially based on a user-agent or perhaps IP address) to avoid wasted server load (and log-file spamming).

Bonus Issues If you know that such requests are possible to prevent IIS log file from fully logging (i.e. if- request-match, if you receive my meaning then forward / Dev / null).

One solution would be better for win2003, but this is a recurring problem - if there is a clean solution for IIS7 but not IIS6, I would be happy to know this.

Edit: Sorry 'Compared to the first incomplete question, I had been tagged with a tab + mistake.

This can be done very easily using the URLRewrite module in IIS7. But I do not really know if it will stop them from logging those requests.

  & lt; Rewrite & gt; & Lt; Rules & gt; & Lt; Rule name = "stop User-agent diagnostics" stop processing = "true" & gt; & Lt; Mail url = ". *" * / / Gt; & Lt; Conditions & gt; & Lt; Input = "{HTTP_USER_AGENT}" pattern = "RogueBotName" /> Add & lt; Add Input = "{MyPrivatePages: {REQUEST_URI}}" Pattern = "(. +)" / & Gt; & Lt; / Status & gt; & Lt; Action type = "AbortRquetta" /> & Lt; / Rules & gt; & Lt; / Rules & gt; & Lt; RewriteMaps & gt; & Lt; RewriteMap name = "MyPrivatePages" & gt; & Lt; Add key = "/ PrivatePage1.aspx" value = "block" /> & Lt; Add key = "/ PrivatePage2.aspx" value = "block" /> & Lt; Add key = "/ PrivatePage3.aspx" value = "block" /> & Lt; / RewriteMap & gt; & Lt; / RewriteMaps & gt; & Lt; / Rewrite & gt;  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -