natalie Posted May 23, 2007 Share Posted May 23, 2007 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~ Quote Link to comment https://forums.phpfreaks.com/topic/52605-php-redirects-referring-url/ Share on other sites More sharing options...
Crimpage Posted May 23, 2007 Share Posted May 23, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/52605-php-redirects-referring-url/#findComment-259600 Share on other sites More sharing options...
natalie Posted May 24, 2007 Author Share Posted May 24, 2007 Is there anything I can add to the PHP code to make it recognized as a referring HTML? I mean without going back an .html redirect... keep it a .php? Quote Link to comment https://forums.phpfreaks.com/topic/52605-php-redirects-referring-url/#findComment-261067 Share on other sites More sharing options...
corbin Posted May 24, 2007 Share Posted May 24, 2007 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> Quote Link to comment https://forums.phpfreaks.com/topic/52605-php-redirects-referring-url/#findComment-261075 Share on other sites More sharing options...
fou2enve Posted May 24, 2007 Share Posted May 24, 2007 i agree with corbin thats prob the only way to do it Quote Link to comment https://forums.phpfreaks.com/topic/52605-php-redirects-referring-url/#findComment-261089 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.