title: Blocking referral spam traffic in asp.net without modifying the web.config
body: <p>I'm using Google Analytics and I'm using filters to remove referral spams. In my <code>web.config</code> file, I also use this:</p>
  
  <pre><code>&lt;rule name="buy-cheap-online.info" patternSyntax="Wildcard" stopProcessing="true"&gt;
      &lt;match url="*" /&gt;
      &lt;conditions&gt;
          &lt;add input="{HTTP_REFERER}" pattern="*.buy-cheap-online.info" /&gt;
      &lt;/conditions&gt;
      &lt;action type="AbortRequest" /&gt;
  &lt;/rule&gt;
  </code></pre>
  
  <p>I have dozens of these rules and I want to add more. There's this file on GitHub that includes a list of spammers: <a href="https://github.com/piwik/referrer-spam-blacklist/blob/master/spammers.txt" rel="nofollow noreferrer">https://github.com/piwik/referrer-spam-blacklist/blob/master/spammers.txt</a> </p>
  
  <p>I could just keep adding rules to the <code>web.config</code> but it seems messy. What's another way to block referral spam traffic in asp.net so that all the sites in the text file can be blocked and if the file changes I can easily add new sites by reuploading the text file?</p>
  
  <p>Note: I'm not asking for code to be written for me; I just want to know what other options I have.</p>