Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8917657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:32:42+00:00 2026-06-15T05:32:42+00:00

I am trying to redirect users on my site that come from a certian

  • 0

I am trying to redirect users on my site that come from a certian referal site to have a special message. I have this:

<?php $REFERER = $_SERVER['HTTP_REFERER'];

  if ($REFERER == "http://www.url.com/") { 
?>

Content Goes Here

?>    
    }
?>

And they do not get the message

I did a test and did it from one of my other sites and echoed what the $_SERVER['HTTP_REFERER']; put out and changed the above code to match it exactly and it worked but I think the issue I am having is the output of the $_SERVER['HTTP_REFERER']; is not EXACTLY the same. For instance if they were on the page www.domain.com/page2/index.php the referrer would be http://www.domain.com/page2/

is there a way to make it so people that come from http://www.domain.com no matter whats after the / ?!?

UPDATE:

I tried all the first 2 answers and could not get it to work (possibly my fault) so i did some research from what they sent and created this:

<?php 
    $mystring = $_SERVER['HTTP_REFERER']; 
    $findme   = 'domain'; 
    $pos = strpos($mystring, $findme);

if ($pos === false) {
    } else {
    echo "content";
 ?>

Is there anything wrong with this option as it seems to work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T05:32:43+00:00Added an answer on June 15, 2026 at 5:32 am

    You can check if the string starts with http://www.url.com/

    if (strpos($REFERER, "http://www.url.com/") === 0) { 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to redirect this page Page to a Jquery mobile website that I'm
We've been trying to redirect from one action to another, hoping that data would
I've had some users trying to access a site that is registered as subdomain.example.com
I have a main web-site that uses passive federation (ADFS 2.0) This website has
I am trying to redirect blackberry users to my mobile site by doing: #
I'm trying to redirect users to Paypal to make a payment but instead the
I want to redirect users trying to access http://example.com/car/ to http://example.com/car/blue/ in .htaccess I
I'm trying to redirect to a page that uses basic authentication, with no success
I'm trying to redirect a few pages to a new domain and I have
We are getting reports from a small number of users that they are ending

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.