: Redirect page to symlink So I have 2 URLs that basically link to the main url using a symlink maindomain.com englishdomain.com -> symlink to maindomain.com frenchdomain.com - >
So I have 2 URLs that basically link to the main url using a symlink
maindomain.com
englishdomain.com -> symlink to maindomain.com
frenchdomain.com - > symlink to maindomain.com/fr
When someone actually lands on maindomain.com/index.php 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 == 'http://www.maindomain.com' || $url == 'http://maindomain.com') {
header('Location: www.englishdomain.com/'); }
if ( $url == 'http://www.frenchdomain.com' || $url == 'http://frenchdomain.com') {
header('Location: www.frenchdomain.com/fr'); }
Is it possible that it's affecting my google ranking?
More posts by @Cofer257
2 Comments
Sorted by latest first Latest Oldest Best
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.
According to php.net/manual/en/function.header.php the header('Location: www.example.com/') command will send a 302 redirect to the client.
You should use a 301 redirect if you want to 'transfer' the SEO Gold on example1.com to example2.com.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.