Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-10-11 22:20:27

jelle
Member
Registered: 2006-06-07
Posts: 165

"Database unavailable" redirect to html page

My database server or program failed for a few minutes today. My content was replaced with a minimalistic “Database unavailable” message. I’d rather have Textpattern redirect to a static html page of my own design or at least allow me to show a custom message and at least my contact information or something similar. Just to tell (future) clients I’m there and all’s well :)

Offline

#2 2006-10-12 01:31:11

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: "Database unavailable" redirect to html page

Indeed a good idea.

I would suggest two things : first the message being translatable/customizable, and an optional temporary redirect (with appropriate http headers) to another URL.

admin_config.php seems the place to set up both, since it can’t be in the db.

Offline

#3 2006-10-12 07:26:22

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: "Database unavailable" redirect to html page

Yes, I agree it’s a good idea, I’ve been thinking about it as well. We can’t use admin_config.php, because that is going away. What we’ll need is some writable cache-directory where we can store the parsed error_xxx pages. Will probably happen in crockery.

Offline

#4 2006-10-12 07:37:16

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: "Database unavailable" redirect to html page

What about config.php then ?

A cached version of the page would be nicer, but I guess more difficult to do.

Offline

#5 2006-10-23 22:06:47

Ace of Dubs
Member
Registered: 2006-04-17
Posts: 446

Re: "Database unavailable" redirect to html page

Yikes.. this has just happened to me as well. I assume its my host crapping out on me, but this is just not cool.

I will follow the progress of this idea with great interest

Offline

#6 2006-10-29 16:48:36

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: "Database unavailable" redirect to html page

nevertheless, where exactly is the “database unavailable” text coming from momentarily?
if we knew, in which textpattern file this is produced we could at least momentarily hack our own redirect in there.

tooot


A hole turned upside down is a dome, when there’s also gravity.

Offline

#7 2006-10-30 00:22:05

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: "Database unavailable" redirect to html page

where exactly is the “database unavailable” text coming from momentarily?

grep.

at least allow me to show a custom message and at least my contact information or something similar

Catch 22. Can’t fetch the necessary info from the database if the database is unavailable.

A redirect would probably do more harm than good – think Googlebot.


Alex

Offline

#8 2006-10-30 06:09:11

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: "Database unavailable" redirect to html page

zem wrote:

Catch 22. Can’t fetch the necessary info from the database if the database is unavailable.

Hence my proposal about putting it in one of the two PHP config file.

A redirect would probably do more harm than good – think Googlebot.

A permanent yes, but a temporary? A 307 for example.

But anyhow, the simplest thing to do is to add a config string (HTML one) in one of the two PHP config files, and let the webmaster localize/customize it the way he wants. Yes I know, it’s tremendous text editing for the webmaster … :) But since by definition the DB is out, it’s mostly the only way.

Offline

Board footer

Powered by FluxBB