Try this, it should work:
<rewrite> <rules> <rule name="RequestBlockingRule1" patternSyntax="Wildcard" stopProcessing="true"> <match url="*" /> <conditions> <add input="{HTTP_REFERER}" matchType="Pattern" pattern="*.semalt.com*" ignoreCase="true" negate="false" /> </conditions> <action type="AbortRequest" /> </rule> </rules> </rewrite>
I tested and verified this, but for the referrer url except * .semalt.com. The key in this code, other than your code, is a wildcard at the end of the referrer template, because the referent URL ends with "/". You can also replace the wildcard at the end with "/", although I believe the pattern should be better.
source share