Mobile app version of vmapp.org
Login or Join
Murphy175

: If you mean that you want to prevent people from visiting your site from that url, you can check for the referrer header and redirect people from that address to another page or whatever

@Murphy175

If you mean that you want to prevent people from visiting your site from that url, you can check for the referrer header and redirect people from that address to another page or whatever you want to do with them.

You can do this in your htaccess file with something like this:

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://www.example.com [NC]
RewriteRule .png www.somewhere.com/something.gif [R]


In PHP you can check for a referrer and redirect them with something like this:

<?
$referer = $_SERVER['HTTP_REFERER'];
if ( $referer != "http://first_url" || "http://second_url" || "http://third_url" || "http://fourth_url" ) {
header('Location: desired_url); exit;
};
?>

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Murphy175

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme