phpbb.com error pages...

Do not post support requests, bug reports or feature requests. Discuss phpBB here. Non-phpBB related discussion goes in General Discussion!
Scam Warning
User avatar
spaceace
Registered User
Posts: 1857
Joined: Wed Jan 30, 2008 8:50 pm
Contact:

phpbb.com error pages...

Post by spaceace » Fri Dec 23, 2016 12:47 pm

how are the error pages set up here? i see they return a correct HTTP status code. i'm using John P's "Error pages" extension and it does not return the correct status code. 404 pages on the phpBB side actually return a 500 status code server side. i'm not asking for extension help, i just want to know how the pages are set up here as phpBB overrides any error handling set in the .htaccess... which i would think it should not do :roll:

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51872
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: phpbb.com error pages...

Post by Brf » Fri Dec 23, 2016 1:14 pm

500 status codes do not come from the software, they are coming from the server itself. They are indicating an error the software is not handling.

User avatar
spaceace
Registered User
Posts: 1857
Joined: Wed Jan 30, 2008 8:50 pm
Contact:

Re: phpbb.com error pages...

Post by spaceace » Fri Dec 23, 2016 1:35 pm

why would phpBB return a 404 when the server actually returns a 500? i can't use .htaccess to control error responses because the phpBB software is overriding it. i just want to get rid of the generic
No route found for "GET /whatever"
and return proper error responses like we could do in 3.0 in the .htaccess. can the symphony response be disabled in favour of using .htaccess ErrorDocument so things will work as they should?

User avatar
Noxwizard
Support Team Leader
Support Team Leader
Posts: 10347
Joined: Mon Jun 27, 2005 8:41 pm
Location: Texas, USA
Name: Patrick Webster
Contact:

Re: phpbb.com error pages...

Post by Noxwizard » Fri Dec 23, 2016 4:17 pm

We use the normal way, which is htaccess ErrorDocument directives.
[Support Template] - [Read Before Posting] - [phpBB Knowledge Base]
Do not contact me for private support, please share the question in our forums.

User avatar
spaceace
Registered User
Posts: 1857
Joined: Wed Jan 30, 2008 8:50 pm
Contact:

Re: phpbb.com error pages...

Post by spaceace » Fri Dec 23, 2016 6:01 pm

Noxwizard wrote:We use the normal way, which is htaccess ErrorDocument directives.
in phpBB 3.1.10, this does not work. i added ErrorDocument 404 "Sorry, not found." to my .htaccess file and then tried to go to https://31.livemembersonly.com/blah.html and i get the following...
Information

No route found for "GET /blah.html"
phpBB 3.1 is overriding the .htaccess ErrorDocument rule no matter what that rule gets set to. is it possible to get around this?

edit:
trial and error...
removing the rewrite rule for app.php lets the ErrorDocument in .htaccess function properly.
remove this

Code: Select all

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ app.php [QSA,L]
and the HTTP status codes appear properly but it breaks extensions that use app.php.

is there something that can be done about this? it's the phpBB software that causes the issue

Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 25454
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: phpbb.com error pages...

Post by Paul » Fri Dec 23, 2016 6:21 pm

The same happens here at phpBB.com; app.php/app You will need to use a extension or edit the core to change the 404 message.
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

User avatar
spaceace
Registered User
Posts: 1857
Joined: Wed Jan 30, 2008 8:50 pm
Contact:

Re: phpbb.com error pages...

Post by spaceace » Fri Dec 23, 2016 6:24 pm

Paul wrote:The same happens here at phpBB.com; app.php/app
not exactly...

try this one...
app

now try this...
https://31.livemembersonly.com/app

something is done differently here. anyway, i edited my post above yours

edit:
you edited your post before i got done with mine... what core code needs to be changed and in what way? Error pages extension does not give a proper HTTP status code

Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 25454
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: phpbb.com error pages...

Post by Paul » Fri Dec 23, 2016 6:28 pm

The reason why it doesn't happen on app is because we don't rewrite URLs to app.php in community/.
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

User avatar
spaceace
Registered User
Posts: 1857
Joined: Wed Jan 30, 2008 8:50 pm
Contact:

Re: phpbb.com error pages...

Post by spaceace » Fri Dec 23, 2016 6:51 pm

Paul wrote:The reason why it doesn't happen on app is because we don't rewrite URLs to app.php in community/.
fair enough...
  • i run my forum from the root of my domain
  • i set an ErrorDocument rule in my .htaccess file which is the same rule i had in phpBB 3.0
  • i get the generic message of
    No route found for "GET /whatever"
    when someone tries a page or url that is not there instead of my .htaccess setting
  • i installed Error pages extension. it displays a 404 but the server actually returns a 500
why and how does the forum software override the ErrorDocument rules when other .htaccess setting are unaffected. if something is not on the server, the .htaccess setting should be allowed to do it's job.

is there a way to allow the forum to work as it should and still keep extensions working too? as in, exactly what .htaccess setting should i be using? the default shipped with phpBB does not work in this case

Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 25454
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: phpbb.com error pages...

Post by Paul » Fri Dec 23, 2016 7:08 pm

None, you can't handle it with .htaccess and keep all extensions working. With the default .htaccess you redirect all traffic that doesn't match one of the old files to app.php/ and that file uses symfony routing to check if a routing matches. If not, then the routing will generate a error message and a 404. You will need a extension to modify that error message, or you will need to modify the core (And I have no idea out of my head what) to change the message.
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

User avatar
spaceace
Registered User
Posts: 1857
Joined: Wed Jan 30, 2008 8:50 pm
Contact:

Re: phpbb.com error pages...

Post by spaceace » Fri Dec 23, 2016 9:03 pm

Paul wrote:or you will need to modify the core (And I have no idea out of my head what) to change the message.
i searched every file in the phpBB package and found the following 2 lines with hard coded language entries...

searched for "No route found for"
only found in /vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/RouterListener.php on lines 113 and 117. those lines are...

Code: Select all

$message = sprintf('No route found for "%s %s"', $request->getMethod(), $request->getPathInfo());

and

$message = sprintf('No route found for "%s %s": Method Not Allowed (Allow: %s)', $request->getMethod(), $request->getPathInfo(), implode(', ', $e->getAllowedMethods()));
what needs to be changed to show a proper error message instead of the hard coded message?

this is not really directed at Paul as i did quote him but more to whoever could provide an answer

User avatar
spaceace
Registered User
Posts: 1857
Joined: Wed Jan 30, 2008 8:50 pm
Contact:

Re: phpbb.com error pages...

Post by spaceace » Sat Dec 24, 2016 3:43 pm

as it turns out, symphony is able to produce proper error messages... How to Customize Error Pages. you would think that by default, this would be part of the forum software. unfortunate for me is that i don't know how to do it :roll:

Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 25454
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: phpbb.com error pages...

Post by Paul » Sat Dec 24, 2016 4:02 pm

I am pretty sure those instructions are for symfony full stack, which phpBB doesn't use, it just uses some symfony components.
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

User avatar
spaceace
Registered User
Posts: 1857
Joined: Wed Jan 30, 2008 8:50 pm
Contact:

Re: phpbb.com error pages...

Post by spaceace » Sat Dec 24, 2016 4:10 pm

that figures :lol:

something else i just read is about error messages and debug mode within symphony...
A "showException" request parameter can be used to force display of an error page (when set to false) or the exception page (when true). If it is not present, the "debug" value passed into the constructor will be used.
does anyone know if this setting is part of phpBB?

development environment causes symphony to display the
No route found for "GET /whatever"
but it does not in a production environment. at least according to the symphony page i linked to. does anyone know about this?

Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 25454
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: phpbb.com error pages...

Post by Paul » Sat Dec 24, 2016 4:11 pm

Again, specific for symfony full stack.
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

Post Reply

Return to “phpBB Discussion”