IIS Mod-Rewrite examples
Overview Documentation Download Purchase FAQ  
IIS Mod-Rewrite - URL rewrite tool for IIS

Example: Robot blocking


In this example we want to block all requests made by an annoying robot. Usually the robots are identified by their name contained in the "User-agent" HTTP header.


#Turn IIS Mod-Rewrite engine on
RewriteEngine On

#Check if "User-agent" HTTP header contains "AnnoyBot"...
RewriteCond %{HTTP_USER_AGENT} AnnoyBot [NC]
#...and if so, send a "Forbidden" HTTP header for any request.
RewriteRule .* - [F]

Download and try
IIS Mod-Rewrite

IIS rewrite

Download IIS Mod-Rewrite

Purchase IIS Mod-Rewrite