Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Send 503 error "Service Temporarily Unavailable" header on MySQL error! 3.6.x & prior Details »»
Send 503 error "Service Temporarily Unavailable" header on MySQL error! 3.6.x & prior
Version: 1.0.0, by Milad Milad is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Board Optimization - Version: 3.6.x Rating:
Released: 04-27-2008 Last Update: Never Installs: 5
Code Changes Translations  
No support by the author.

Brought to you by Syrian Medical Society & Milado

Introduction & Description:
Sometimes, for a reason or another, MySQL server halts and vBulletin prints the MySQL error!

But Google will still index your pages even if they contain that error rather than the actual content!

What if that error lasts for many hours? many pages will get indexed during this breakdown, and will be replaced (if already indexed) with a no-content-but-a-MySQL-error page!

Here is a solution which will work for all vBulletin versions through the three generations (3.0 3.5 and 3.6)!

We will send a 503 error "Service Temporarily Unavailable" header, and Google will understand the message, and refrain from indexing your pages.

Installation for 3.7.x:
No need! this is already implemented in 3.7.x generation!

Installation for 3.5.x and 3.6.x:
In includes/class_core.php find:

PHP Code:
die($message); 
Add before it the following:

PHP Code:
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 3600'); 

Installation for (3.0.x):
In includes/db_mysql.php find:

PHP Code:
echo "<html><head><title>$vboptions[bbtitle] Database Error</title>"
Add before it the following:

PHP Code:
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 3600'); 

A comment:
It won't be simpler! no way to do this via plug-ins, as the MySQL error probably will prevent vBulletin from getting the plug-ins from the database!
To check how many database errors had been indexed by Google, use the following query:
Code:
site:syrianmeds.net "Database error"
replace syrianmeds.net with your site domain name!



Change log:
  • 1.0.0 first public release, on April, 28 2008
Click install to receive support & updates.

You like it? nominate it.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 04-28-2008, 10:31 AM
KURTZ KURTZ is offline
 
Join Date: Nov 2006
Location: Italy
Posts: 2,257
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

looks simple!
Reply With Quote
  #3  
Old 04-28-2008, 10:36 AM
Milad's Avatar
Milad Milad is offline
 
Join Date: Apr 2005
Location: Syro
Posts: 663
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KURTZ View Post
looks simple!
But clever again!
Reply With Quote
  #4  
Old 04-28-2008, 11:11 AM
Rickeo's Avatar
Rickeo Rickeo is offline
 
Join Date: Jan 2007
Location: Manchester
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is really genius actually simple but really handy installed and nominated

Rick
Reply With Quote
  #5  
Old 04-28-2008, 12:00 PM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sounds like a Great SEO mod. Thanks.
Reply With Quote
  #6  
Old 04-28-2008, 12:22 PM
testebr testebr is offline
 
Join Date: Jan 2004
Posts: 353
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Milad,

Please read this http://www.vbulletin.com/forum/showthread.php?t=268710

Cya
Reply With Quote
  #7  
Old 04-28-2008, 01:32 PM
Milad's Avatar
Milad Milad is offline
 
Join Date: Apr 2005
Location: Syro
Posts: 663
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I already suggested this a while ago http://www.vbulletin.com/forum/showthread.php?t=230053

It had been implemented in 3.7

I'm happy!
Reply With Quote
  #8  
Old 04-29-2008, 08:45 AM
Jasem's Avatar
Jasem Jasem is offline
 
Join Date: Feb 2006
Location: www.menokia.com
Posts: 594
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much
Reply With Quote
  #9  
Old 04-29-2008, 09:42 AM
killerkraft's Avatar
killerkraft killerkraft is offline
 
Join Date: Mar 2006
Location: Portugal
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Brilliant.

Thank you.
Reply With Quote
  #10  
Old 05-09-2008, 02:20 PM
myown myown is offline
 
Join Date: Jan 2007
Posts: 145
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for this sure will be installing soon.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:45 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04661 seconds
  • Memory Usage 2,296KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete