Sunday, September 19, 2021

Don’t lose your visitors when your database is unavailable

- Advertisement -spot_img
- Advertisement -Traffic Analysts Tool

When your WordPress blog has trouble connecting with the database, it returns a nice “Error Establishing a database connection”.

wordpress-database-error

Instead of losing visitors, db-error.php might be the useful solution.
You should create and place it in the wp-content folder. After that paste this short code in it.

<?php
// db-error.php

$host=$_SERVER['HTTP_HOST'];
$uri=urlencode($_SERVER['REQUEST_URI']);
header("Location: http://google.com/search?q=cache:$host$uri");
exit();

?>
- Advertisement -Traffic Analysts Tool

the visitor is automatically redirected to the Google cache of the requested page. This avoids losing a visitor.

- Advertisement -Traffic Analysts Tool
- Advertisement -Traffic Analysts Tool
- Advertisement -
Hamza Mikouhttp://www.mikou.net
The owner of www.blogprocess.com and many other blogs. He started making money from the internet 12+ years ago. And BlogProcess is his way to giveback and show people how to do the same. Find more about him at:
Latest news
- Advertisement -



Liquid Web Storm VPS
Related articles
- Advertisement -Traffic Analysts Tool