I want to block users to our site that are coming from links on seriously inappropriate website (e.g. warez, link bait sites, etc).
I have tried this but doesn't work - I go to the blocked site, click there to our site, they still get our site:
Under Rules:
<rule name="Blacklist block" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_REFERER}" pattern="^(?:https?:\/\/)?(?:www\.)?([^\/]+)(.+)?$" />
<add input="{DomainsBlackList:{C:1}}" pattern="^block$" />
</conditions>
<action type="AbortRequest" />
</rule>
Then under Rewrite:
<rewriteMaps>
<rewriteMap name="DomainsBlackList" defaultValue="allow">
<add key="badsite.com" value="block" />
</rewriteMap>
I've seen this format used as examples all over Stack Exchange, Googling, etc., so not sure why it won't work.
Am I misunderstanding how to have the link basically go nowhere when clicked from the refering site (or show blocked)?
Referer
header as you expect?