Home > General > Affiliate Marketing Forum

Landing page redirect script based on referrer? (2)


10-05-2017 05:36 AM #1 bluecrayon (Member)
Landing page redirect script based on referrer?

Any wiz's know of a reliable script to put on your LP that redirects all users to some other page if they don't come from your tracker?

Basically: if user comes from your tracker, script does nothing. if user did not come from your tracker, redirect them to a different page


10-05-2017 09:41 AM #2 caurmen (Administrator)

Not the most secure thing ever (there are various ways to get around it), but if you place this at the very top of a landing page which is implemented in PHP it should work.

Code:
$my_tracker_url = "track.mydomain.com"; 
if (strpos($_SERVER['HTTP_REFERER'], $my_tracker_url) == false) 
{
   header('Location: http://www.placetogoifyoudontcomefrommytracker.com/');
}
For a more secure version you'd want to have your tracker add a unique key to the URL which the LP then decodes and checks, but that's outside the scope of a quick forum post!


Home > General > Affiliate Marketing Forum