I have two addresses for two servers:



I have all my websites installed in www.urlB.com, but visitors recognize www.urlA.com primarily.

I have www.urlA.com/index.php as the following

header('Location: http://www.urlB.com/');

But, when I use this forwarding method, the tracking javascript in www.urlB.com cannot recognize where the visitors are from. I only obtain "NO REFERRING LINK"

What should I do to do the following two jobs: 1. to forward urlA.com to urlB.com 2. to receive the referrer information


Try using a 301 redirect:

header('Location: http://www.urlB.com/', true, 301);
  • This works charm!!! – Chang Feb 26 '11 at 19:10
  • 1
    Then select it as the correct answer! ;) – John Conde Feb 26 '11 at 19:24
  • Weird, that doesn't seem to make a difference on my test server. In either case, if the redirecting page is accessed via a link, referer data is passed, but if it's accessed directly, no referer data is passed. Whether I use 301 or the default 302 doesn't make a difference. – Lèse majesté Feb 27 '11 at 4:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.