Solved

URL redirection by referer

Posted on 2000-03-04
2
151 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
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
spacing 5 24
PHP Variable into a number 3 33
How to keep a password file on your Windows PC? 21 155
update field on focusout 15 19
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
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.

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now