I don't want to display some content if visitors are coming from domain1.com domain2.com or domain3.com
<script>
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
}
</script>
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.
I am new on this... Please do not suggest any htaccess rewrite rule
Thanks