Page 1 of 2

400 & 500 Error Pages

Posted: 06 Jun 2011, 22:26
by Ashley.S.
I added the 400 & 500 Error Pages to the mod the other day on my install, if anyone wants these edits, let me know and I'll go dig them out for you :)

Re: 400 & 500 Error Pages

Posted: 06 Jun 2011, 22:40
by Stoker
Some of the error pages cant be controlled by phpBB.
I am not 100% sure about the 400 bad request, but the 500 internal server error page will not be displayed because it is impossible to display any phpBB page when there is an internal server error.

Re: 400 & 500 Error Pages

Posted: 06 Jun 2011, 22:50
by Ashley.S.
Stoker wrote:Some of the error pages cant be controlled by phpBB.
I am not 100% sure about the 400 bad request, but the 500 internal server error page will not be displayed because it is impossible to display any phpBB page when there is an internal server error.
Previously when my host were doing a lot of upgrades, all php sites got 500 internal server errors, and it ran the error page fine, it just would'nt let you go anywhere else, lol

Re: 400 & 500 Error Pages

Posted: 06 Jun 2011, 22:53
by darkonia
pls post it ashley!

Re: 400 & 500 Error Pages

Posted: 06 Jun 2011, 23:10
by Ashley.S.
open up: .htaccess
Find:

Code: Select all

ErrorDocument 401 /error.php?mode=401
Add Before:

Code: Select all

ErrorDocument 400 /error.php?mode=400
Find:

Code: Select all

ErrorDocument 404 /error.php?mode=404
Add After:

Code: Select all

ErrorDocument 500 /error.php?mode=500
open up: error.php
Find:

Code: Select all

	case '401':
		page_header($user->lang['ERROR_TITLE401']);
		$template->set_filenames(array(
			'body' => 'error/401_body.html')
		);
	break;
Add Before:

Code: Select all

	case '400':
		page_header($user->lang['ERROR_TITLE400']);
		$template->set_filenames(array(
			'body' => 'error/400_body.html')
		);
	break;
Find:

Code: Select all

	case '404':
		page_header($user->lang['ERROR_TITLE404']);
		$template->set_filenames(array(
			'body' => 'error/404_body.html')
		);
	break;
Add After:

Code: Select all

	case '500':
		page_header($user->lang['ERROR_TITLE500']);
		$template->set_filenames(array(
			'body' => 'error/500_body.html')
		);
	break;
open up: language/en/mods/error.php
Find:

Code: Select all

	'ERROR_TITLE401'			=> '401 Authorization Required',
Add Before:

Code: Select all

	'ERROR_TITLE400'			=> '400 Bad Request',
Find:

Code: Select all

	'ERROR_TITLE404'			=> '404 Not Found',
Add After:

Code: Select all

	'ERROR_TITLE500'			=> '500 Internal Server Error',
Find:

Code: Select all

	'ERROR_AUTH_REQUIRED'		=> 'This server could not verify that you are authorized to access the document requested.',
Add Before:

Code: Select all

	'ERROR_BAD_REQUEST'		=> 'Your browser sent a request that it could not understand.',
Find:

Code: Select all

	'ERROR_NOT_FOUND'			=> 'The requested resource could not be found but may be available again in the future.',
Add After:

Code: Select all

	'ERROR_SEVER_ERROR'			=> 'The server encountered an internal error or misconfiguration and was unable to complete your request.',
Last but no means least, upload the zip package below to styles/prosilver/template/error/
400-500_body.zip
(981 Bytes) Downloaded 238 times
Enjoy!

Re: 400 & 500 Error Pages

Posted: 06 Jun 2011, 23:18
by Stoker
Thanks, I will check it out.
Maybe the "problem" at my server is that it is set up to use custom error pages.

Re: 400 & 500 Error Pages

Posted: 06 Jun 2011, 23:19
by Ashley.S.
Stoker wrote:Thanks, I will check it out.
Maybe the "problem" at my server is that it is set up to use custom error pages.
maybe, and oops I forgot that edit :roll: will add that now

Re: 400 & 500 Error Pages

Posted: 06 Jun 2011, 23:49
by Stoker
I have checked this. 500 internal doesnt work on my server.
But since it is working for you I will include it in next version.

Re: 400 & 500 Error Pages

Posted: 07 Jun 2011, 00:21
by darkonia
thx stoker and ashley!

Re: 400 & 500 Error Pages

Posted: 07 Jun 2011, 00:23
by Ashley.S.
darkonia wrote:thx stoker and ashley!
No Problem 8-)