Jump to content

Recommended Posts

hi guys, I have a question (who doesn't!) about php redirects. I used to use HTML redirects, but they were slow and bulky. So I switched the php ones, but now I have another issue. I need a simple redirect, but I want to hide the original url. For example:

 

www.blah.com - and then user will click a link (php redirect page www.blah.com/redirect.php) and go to www.sales.com

 

I need for my traffic to look like it's coming from www.blah.com/redirect.php. But what I'm getting is www.blah.com. With the html redirects it would just show the redirection page url. Is there something I can insert into the php redirect page to make it show THAT as the referring url?

 

Here's an example of my php direct page:

 

<?php

Header('Location: http://www.sales.com');

Exit;

?>

 

That's it. If you know what to add to that could you kinda spell it out. I'm a tad slow. =)

Thanks! ~Natalie~

Link to comment
https://forums.phpfreaks.com/topic/52605-php-redirects-referring-url/
Share on other sites

I have no tested knowledge on this but this would be my theory as to why it's happening.

 

The referrer URL has to come from the client browser, otherwise how is my website going to send the new website its location? I think because PHP is processed before the page is displayed to the end user, and you are transferring them to another website before any HTML is actually sent to the browser, I would say that the last page the end user really actually sees really is the blah.com/ page. This may be why it is showing up like that.

 

Maybe a Javascript redirect might help. That way something can be displayed in the browser for 2 seconds on the redirect.php page before it bounces them over to the new website?

 

Hope that thought helps... somehow :|

 

Dave.

If that header method keeps giving the wrong referrers you could do something like this:

 

<meta http-equiv="refresh" content="0;url=http://sales.com/">
<!-- content is the time to wait.... weird name right? -->
<script language="javascript">
<!--
window.location = "http://sales.com/";
//-->
</script>

If your browser does not automatically redirect you, please click <a href="http://sales.com/">here</a>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.