How can I get Price Tapestry to return a 404 error page when it failes to connect to the database?
Currently it displays a page with something along the lines of "database connection failed" - which is a "200" document sucessfully loaded page?
Long story, but one of my Price Tapestry sites is on unreliable hosting. I pay $4 a month to monitor it, and the monitoring is checking the website is up. As far as it's concenrend a database connection failed page is successfull.
Cheers David, works a treat
serviceuptime.com :-)
eukhost.com :-(
Hi Paul,
You could try this for starters - in includes/database.php, look for the following code on line 14:
$link = @mysql_connect($config_databaseServer,$config_databaseUsername,$config_databasePassword);
...and REPLACE this with:
$link = @mysql_connect($config_databaseServer,$config_databaseUsername,$config_databasePassword);
if (!$link)
{
header("HTTP/1.0 404 Not Found");
exit();
}
Cheers,
David.