Solved

URL redirection by referer

Posted on 2000-03-04
2
164 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

749 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