Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

So I have 2 URLs that basically link to the main url using a symlink -> symlink to - > symlink to 

When someone actually lands on it will automatically redirect them to the appropriate symlink

The problem I'm having is I think it's affecting my google ranking and I'm not sure why..

this is my redirect code

$url = "http://" . $_SERVER['HTTP_HOST'];

if ( $url == '' || $url == '') {
if ( $url == '' || $url == '') {

Is it possible that it's affecting my google ranking?

share|improve this question
Using PHP to perform the redirect is marginally slower than using mod_rewrite - is there a reason you are avoiding mod_rewrite? – danlefree Sep 22 '10 at 1:57
Would using mod_rewrite affect my ranking or google analytics for that matter or is it simply the same result just faster? – Serge Sep 22 '10 at 19:57
Same result just faster: Google Analytics relies on a Javascript call which won't be triggered if you redirect using mod_rewrite or PHP and your server logs will continue to show the redirects occurring. – danlefree Sep 22 '10 at 22:55

2 Answers 2

up vote 4 down vote accepted

According to the header('Location:') command will send a 302 redirect to the client.

You should use a 301 redirect if you want to 'transfer' the SEO Gold on to

share|improve this answer
I believe you have the right answer but I have yet to see any difference. I'm also running a google adwords campaign as well as several ads placed on ad networks and I have yet to see any of those websites in a search result (except of course for the sponsored ad) Even a search for yields no result – Serge Sep 22 '10 at 19:58
well it's finally starting to show up in results even though webmaster tools doesn't show any information about the links – Serge Sep 29 '10 at 22:49

In addition to mawtex' answer (which I believe is correct):

// 301 Moved Permanently
header("Location: /foo.php",TRUE,301);

...should do the trick. But please test this thoroughly.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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