title: Prevent redirection from an external website to my domain
body: <p>I'm looking for a solution to prevent redirection from an external website to my domain. Let's say, I have a domain call <strong>abcd.com</strong> and I found another domain call <strong>xyz.biz</strong> is redirected their all traffic to my domain. I wanted to stop that queries/redirection that comes from xyz.biz</p>
  
  <p>I'm using IIS8/Windows Server 2012 and tried following configurations but no luck.</p>
  
  <p><strong>Option 1:</strong> I have added below HTTP_REFERER script in web.config file but still it accepts that redirection request.</p>
  
  <pre><code>&lt;rule name="DenyAccess" stopProcessing="true"&gt;
      &lt;match url="(.*)" /&gt;
      &lt;conditions logicalGrouping="MatchAny" trackAllCaptures="false"&gt;
      &lt;add input="{HTTP_REFERER}" pattern="xyz.biz" /&gt;
      &lt;add input="{HTTP_REFERER}" pattern="www.xyz.biz" /&gt;
      &lt;/conditions&gt;
      &lt;action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" /&gt;
  &lt;/rule&gt;
  </code></pre>
  
  <p><strong>Option 2:</strong> I tried to add following PHP script in index.php file but it didn't work.</p>
  
  <pre><code>$ref=$_SERVER['HTTP_REFERER'];
  if($ref=="http://xyz.biz" || $ref=="http://www.xyz.biz"){
   exit();
  }
  </code></pre>
  
  <p>When I do <strong>echo $_SERVER['HTTP_REFERER']</strong> then it returns empty results and couldn't see any details captured from xyz.biz</p>
  
  <p>Can anyone suggest an idea how we can approach this issue? Thanks in advance.</p>