[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

URL redirection by referer

Posted on 2000-03-04
2
Medium Priority
?
183 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 300 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses
Course of the Month19 days, 5 hours left to enroll

834 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