URL redirection by referer

I want to make a user go to one page if the referer is one site, and a different page if the referer is a different site or if there is no referer.

Who is Participating?
maxkirConnect With a Mentor Commented:
It could be your  page that performs redirect:


if (strstr($HTTP_REFERER, $one_url) != false )
    Header("Location: $first_redirect_url");
   // No referer or referer is not $one_url
    Header("Location: $another_redirect_url");
TAF2000Author Commented:

Thats exactly what I was looking for, but now I realize I was looking for the wrong thing..

Here's the problem...I have 2 domains pointing to the same website, can I make each go to a different website using PHP?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.