Forum Moderators: phranque

Message Too Old, No Replies

Redirect when MySQL db is down

Automatically display maintenance page when db goes down

         

jshare

3:32 pm on Mar 15, 2007 (gmt 0)

10+ Year Member



I know this can be done in PHP, but can I do this directly from an .htaccess file?

Whenever my MySQL server is unreachable, I'd like to automatically redirect all site traffic to a php or html page.

Bonus points if I can log how long the MySQL server was unreachable. I don't have access to the MySQL server logs.

Thanks in advance,

Jacob

coopster

2:53 am on Mar 16, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, jshare.

Short answer is no. Long answer is, if you wrote your own Apache module or found an extension module that offered the feature, yes. Best approach? Use the server-side scripting route.

jshare

3:23 pm on Mar 28, 2007 (gmt 0)

10+ Year Member



Thanks coopster, I'll give it a shot.