Dynadot — .com Transfer

Autoclose if visitor comes via certain site?

Spaceship Spaceship
Watch

Rusty

New Member
Impact
0
Hey Guys,

I have a client with a website that someone else (annoying) has linked to via his own website trying to affiliate himself with the organisation. The client doesn’t want anything to do with him.

Is it possible to autoclose our webpage if the user comes via his website?

Rusty
:D
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
You could try this Javascript code, it is untested.

Code:
if (document.referrer == 'http://the-site-that-shouldnt-be-linking.com')
{
    document.location("http://google.com");
}
If someone came from http://the-site-that-shouldnt-be-linking.com, they would get sent to Google. :tu:

Adrian
 
0
•••
If the Site/Entry page being linked to is php - You could add something above the Head section to filter out traffic from the site. It allows for the possiblility there may be other "Referring Pages" or they may be coming from www. somebadsite.com/badpage.php instead of somebadsite.com/badpage.php (with or without www).


Code:
<?php
$refurl = $_SERVER['HTTP_REFERER'];
$badsite = "http://www.namepros.com/website-development/307691-autoclose-if-visitor-comes-via-certain.html";
    $match = similar_text($badsite, $refurl, $percentage);
    $percentage = round($percentage, 2);
 	if ($percentage <= "60") {
echo "<b>Welcome - You came from $refurl which matches with a $percentage Percentage</b>";
    } else {
header( 'Location: http://www.namepros.com/website-development/307691-autoclose-if-visitor-comes-via-certain.html' ) ;
	}
?>

Try it by clicking :
www.multiurl.com/badsite.php


Of course you don't need the Welcome echo .... and you can adjust the percentage to what you need from

May or May not be useful - I've used something similar to make sure people only come from "Entry" pages I choose within my own site ;)

If you come from :
http://www.namepros.com/showthread.php?p=1839611

You are allowed in ....

If you come from :
http://www.namepros.com/website-development/307691-autoclose-if-visitor-comes-via-certain.html

You aren't allowed in ....


Like I said - You'd have to adjust the percentage allowable ;)
 
Last edited:
0
•••
Instead of turning people away for what seems little fault of their own - why not redirect them to a specially crafted webpage explaining that they have nothing to do with other character?
 
0
•••
whitebark said:
Instead of turning people away for what seems little fault of their own - why not redirect them to a specially crafted webpage explaining that they have nothing to do with other character?


Yeah - I meant to mention that part as well ;) But got too caught up in the script - lol

:tu:
 
0
•••
Mark said:
Yeah - I meant to mention that part as well ;) But got too caught up in the script - lol

:tu:

And I should have added you can use Mark's or Adrian's code to do it. :lol:
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer

We're social

Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back