Solved

URL redirection by referer

Posted on 2000-03-04
2
154 Views
Last Modified: 2011-09-20
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.

Thanks
0
Comment
Question by:TAF2000
2 Comments
 
LVL 2

Accepted Solution

by:
maxkir earned 75 total points
ID: 2584674
It could be your  page that performs redirect:

<?php

if (strstr($HTTP_REFERER, $one_url) != false )
{
    Header("Location: $first_redirect_url");
    exit();
}
else
{
   // No referer or referer is not $one_url
    Header("Location: $another_redirect_url");
}
?>
0
 

Author Comment

by:TAF2000
ID: 2586080
Thanks..

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?
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question