400 & 500 Error Pages

Download and support for PhpBB3 Error Pages
User avatar
Ashley.S.
BBCoder II
BBCoder II
Posts: 36
Joined: 05 Mar 2010, 12:24
Location: Falmouth, Cornwall, UK
Contact:

400 & 500 Error Pages

Post 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 :)
Regards,
-Ashley.S. [ Pluto Hosting Managing Director & ProphpBB Moderator ]
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: 400 & 500 Error Pages

Post 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.
Board rules! No PM support
User avatar
Ashley.S.
BBCoder II
BBCoder II
Posts: 36
Joined: 05 Mar 2010, 12:24
Location: Falmouth, Cornwall, UK
Contact:

Re: 400 & 500 Error Pages

Post 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
Regards,
-Ashley.S. [ Pluto Hosting Managing Director & ProphpBB Moderator ]
User avatar
darkonia
BBCoder II
BBCoder II
Posts: 57
Joined: 23 May 2011, 19:40
BBCodes: 35
Favourite BBCode: hs bbcode
Favourite MOD: dm video
Location: Munich

Re: 400 & 500 Error Pages

Post by darkonia »

pls post it ashley!
User avatar
Ashley.S.
BBCoder II
BBCoder II
Posts: 36
Joined: 05 Mar 2010, 12:24
Location: Falmouth, Cornwall, UK
Contact:

Re: 400 & 500 Error Pages

Post 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 255 times
Enjoy!
Last edited by Ashley.S. on 06 Jun 2011, 23:22, edited 1 time in total.
Regards,
-Ashley.S. [ Pluto Hosting Managing Director & ProphpBB Moderator ]
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: 400 & 500 Error Pages

Post 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.
Board rules! No PM support
User avatar
Ashley.S.
BBCoder II
BBCoder II
Posts: 36
Joined: 05 Mar 2010, 12:24
Location: Falmouth, Cornwall, UK
Contact:

Re: 400 & 500 Error Pages

Post 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
Regards,
-Ashley.S. [ Pluto Hosting Managing Director & ProphpBB Moderator ]
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: 400 & 500 Error Pages

Post 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.
Board rules! No PM support
User avatar
darkonia
BBCoder II
BBCoder II
Posts: 57
Joined: 23 May 2011, 19:40
BBCodes: 35
Favourite BBCode: hs bbcode
Favourite MOD: dm video
Location: Munich

Re: 400 & 500 Error Pages

Post by darkonia »

thx stoker and ashley!
User avatar
Ashley.S.
BBCoder II
BBCoder II
Posts: 36
Joined: 05 Mar 2010, 12:24
Location: Falmouth, Cornwall, UK
Contact:

Re: 400 & 500 Error Pages

Post by Ashley.S. »

darkonia wrote:thx stoker and ashley!
No Problem 8-)
Regards,
-Ashley.S. [ Pluto Hosting Managing Director & ProphpBB Moderator ]
Locked