title: Block access to certain domains with document.referrer
body: <p>I don't want to display some content if visitors are coming from domain1.com domain2.com or domain3.com</p>
  
  <pre><code>&lt;script&gt;
  var refers = document.referrer;
  
  if(refers!="domain1.com") {
  // bye bye content will not be displayed if domain1.com is the refer
  } else if (refers!="domain2.com"){
  // bye bye content will not be displayed if domain2.com is the refer
  } else if (refers!="domain3.com") {
  // bye bye content will not be displayed if domain3.com is the refer
  } 
  else {
  // All other domains referrers are allowed to see the content
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>This code don't work, the another problem is that document.referrer do not grab sub-domains or www. Must be exactly as requested domain1.com if it contains www will not be detected.</p>
  
  <p>I am new on this... Please do not suggest any htaccess rewrite rule</p>
  
  <p>Thanks</p>