Subscribe to Bidilicious Posts

Posts Tagged ‘phplinkbid’

Posted by Bidilicious, February 17th, 2008
Popularity: 53% | Permalink » | 1 Comment »

If you have tried to submit your phpLB bidding directory to Google’s Webmaster Tools using the file upload verification method, you have no doubt seen that Google does not like the way phpLB handles 404 error pages.

If you visit practically any bidding directory which is running this software and enter a URL which does not exist, such as:

http://www.directoryname.com/not-here.html

You will be presented with a nicely formatted error page informing you that the page your looking for doesn’t exist. When you request the page the phpLB software responds with a HTTP Header status code of “200 OK”. This is known in the industry as a Soft 404.

This is bad because it causes problems for services such as Google’s Webmaster Tools and search engine spiders. The way Google’s tool works is that you need to upload a file to prove ownership of the web site, if your site returns a soft 404 Google cannot determine if you really uploaded the file. In addition the search spiders have problems and waste bandwidth by trying various made up paths on your domain to try and obtain a hard 404 error.

Fortunately it is easy to fix, simply open up the index.php file and depending on your version…

Version: 1.4

Lines 158 to 161 read:

{
$tpl->define('page', 'error404.tpl');
$tpl->parse('page');
}

Change this to:

{
header("HTTP/1.0 404 Not Found");
$tpl->define('page', 'error404.tpl');
$tpl->parse('page');
}

Version: 1.0

Lines 201 to 204 read:

{
$tpl->define('page', 'error404.tpl');
$tpl->parse('page');
}

Change this to:

{
header("HTTP/1.0 404 Not Found");
$tpl->define('page', 'error404.tpl');
$tpl->parse('page');
}

Upload the index.php file to your site and thats it, your all done. Your phpLB will continue to return a nicely formatted error page but will do so with the correct HTTP Header status code of 404.

Tags: , , ,