Hello David,
When a merchant has removed a product. I get a page with the message product no longer available. And under this message some related products.
Is it possible/usefull to create a 301 message? Or did you make it with a reason showing no 301 message?
Thanks Jan Roel
Hi David.
I have tried the above but doesn't work on the version i have.
I am looking for the same as above but to direct the user to the home page if a product is not available anymore. Or if you have a better idea of what to shwo the user when a products is not available that would be great.
Many thanks
Paul
Hello Paul,
In the version of products.php that you are running, locate to the call to include the header HTML;
require("html/header.php");
..and REPLACE with:
if (!isset($product))
{
header("Location: ".$config_baseHREF);
exit();
}
require("html/header.php");
(the above will be common to all distributions, whereas code further up products.php has changed slightly over the years...)
Cheers,
David.
--
PriceTapestry.com
Hello Jan,
301 is Moved Permanently would only really be appropriate if a new page for the exactly the same product could be identified but as that is unlikely to be the case. However if you would like to free up resources for further search engine coverage returning 410 (Gone) might be worth a try. To add the header, simply edit products.php and look for the following code at line 78:
$banner["h2"] .= "(".translate("product no longer available").")";
...and REPLACE with:
$banner["h2"] .= "(".translate("product no longer available").")";
header("HTTP/1.0 410 Gone");
The page will still return Related Products as useful information and an opportunity to keep the visitor on your site but search engines should still consider the page as gone and would only revisit if a link to it from your own site continued to exist, which should not be the case for old products...
Hope this helps!
Cheers,
David.
--
PriceTapestry.com