Jump to content

header redirecting and google crawl -SEO


dflow

Recommended Posts

i have a certain a page i currently dont want clients to see as

i no longer have the specific product.

 

i created a hard redirect :

header("Location: http://nysite.com");

 

i understand that the default is regarded by serps as redirect 302 (temporary redirect)

 

now this page has great google positions in many keywords

and i believe ill sell this product again

the question is :

does this redirect harm my google positioning?

and if so what alternative do you guys propose?

 

 

Link to comment
https://forums.phpfreaks.com/topic/156246-header-redirecting-and-google-crawl-seo/
Share on other sites

302 Temporary redirect are used when you upgrade a site or too handle huge amount of traffic that suddenly arrive or when the site crash for whatever reason. The target page may get crawled by search engine but it won't added any value to it.

 

301 Redirect mean the page has been renamed. It should be the same page (or almost the same page) and search engine will use all the backlinks and the old page value/rank and give it to the new page.

 

In your case the page has been deleted, you probably should sent a 410 code meaning the you know the page doesn't exist anymore. Same as a 404 but in a 404 not found you tell the client don't know if the page is gone permanently or if it's only a temporary problem. Search engine may come back for a while to visit a 404 and see if the page is there or not, they won't come back if you sent a 410 code.

 

That the true definition of http header code :

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

 

In real life you can use a 301 and try to save the page value and give it to another different page. The 301 code should be used only when a page has been renamed and not for a different page, but search engine will never penalized you for this. Try to save the page rank/value and give it to another page is the best thing to do, search engine may transfers is value or not but you won't loose anything. From a SEO point of view only do a 301.

 

The user may get confused since it get redirect to a new different page without any error message and may try to find the products with a differents way. It's probably better for them that you put a page telling them the products don't exist anymore and offer something else instead. From a human user only point of view i think you should display a error with link to others products/main page and some others link that may help him.

 

Whatever you choose you can redirect with a 301 like this :

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://nysite.com");
die();
?>

Don't forget the die() or the page will continue to be executed and be sent with the redirect. (and of course don't echo any output before the header() function or it will fail)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.