MyBB Community Forums

Full Version: 503 for errors
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Whenever I have mysql errors with my site I run the very real risk that Google will index the error page.

So today I sought a solution. I'd like to recommend that this be added to MyBB.

Edit inc/class_error.php

			@header("Content-type: text/html; charset={$charset}");

Add before it:

@header('HTTP/1.1 503 Service Temporarily Unavailable');
@header('Status: 503 Service Temporarily Unavailable');
@header('Retry-After: 1800');

Effectively this tells Google and other search engines the service is not available and to try again in 30 minutes (1800 seconds).

Please MyBB consider this change. It's good SEO.
Seems quite logical. Doesn't seem like a huge change. I don't see a reason that this could be shot down.
I too think that MyBB should use HTTP error codes for error pages. Not just SQL errors, which are rare, but also your every day no permission or invalid forum/thread/etc errors. Currently my Google SEO plugin gives them a 404 error, which may not be an optimal solution, but it doesn't change how it shows up in the browser, and it keeps them out of Google.

Apart from Google and SEO, proper error codes also have other uses. For example, my dedicated server host offers a monitoring service. I can tell it to go fetch a HTML page of my site every 5 minutes, and if this returns with an error code, I receive a mail telling me that my web site is down. If it's still down after an hour, it'll send me a reminder. It'll also send me a mail when it's back up, so I can tell exactly that the site was unreachable from xx:xx-yy:yy even if it was in the middle in the night when I would usually not notice.

However this monitoring service also only looks at the HTTP status code... if it's 200 OK it thinks all OK, it only reports when it gets 4xx or 5xx status. Which it currently doesn't get from MyBB so such problems will go unnoticed with a MyBB site.
I also +1 this advice.
Yeah, that is a good idea. But you have a slim chance of a SE spider crawling an error page on your forum unless that error has been there for quite a considerable amount of time.
I have had this happen to me 3 times....yesterday even. It's fixed now but my site is under constant crawl from Google so even a 10 minute error can get indexed. The appropriate thing to do for an error page is display it with an actual http error code. I don't agree the permission page should have an http error code though.

It's a few lines in one file. Easy change that makes sense.
This is a pretty sensible idea.
Is this still being added to 1.6?
I doubt it since 1.6 is featured locked. Although I'm not staff.
Ahh, what difference does it make really? Unless it may cause a bug, there's no problem adding this. Simple and quick.
Pages: 1 2