Will 3.1 be handling it's own 404 pages?

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The current feature release of phpBB 3 is 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
User avatar
Pete77s
Registered User
Posts: 43
Joined: Mon Feb 07, 2005 4:55 am

Will 3.1 be handling it's own 404 pages?

Post by Pete77s »

I'm using ErrorDocument 404 /error.php in .htaccess and it's always worked fine with 3.0.x

Currently it seems 3.1 is handling 404 errors with
No route found for "GET /other_directory/file_gone.txt"

file or directory has nothing to do with phpbb, yet it's being styled up with a phpbb page info.

It is sending proper headers to browser but it's not very user friendly I think.




:edit: hm, I don't know either but it seemsRewriteRule ^(.*)$ app.php [QSA,L] is the culprit cus it doesn't matter where I set ErrorDocument before/after top/below in .htaccess. :?

neuropass
Registered User
Posts: 22
Joined: Thu Apr 11, 2013 7:24 pm

Re: Will 3.1 be handling it's own 404 pages?

Post by neuropass »

This is a great question. Can the team reply on this?

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1904
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: Will 3.1 be handling it's own 404 pages?

Post by DavidIQ »

The simple answer to the topic question is: No. This apparent 404 handling is a side-effect of the routing being done by composer and has not been looked at for actual processing and displaying of any associated messages. It might be as simple as looking at the response header and just displaying a simple/proper message but this is the first time anyone's actually mentioned this so there aren't even language strings for the responses.
Image

Nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 299
Joined: Sun Apr 13, 2014 1:40 am
Location: Paris

Re: Will 3.1 be handling it's own 404 pages?

Post by Nicofuma »

in fact, you use the url rewriting to hide the app.php file, isn't it ?
So when you try to access to /other_directory/file_gone.txt the url is rewrited to app.php/other_directory/file_gone.txt and phpBB tries to load a route matching /other_directory/file_gone.txt. But no route matchs so an error 404 is displayed.
Member of the phpBB Development-Team
No Support via PM

User avatar
Pete77s
Registered User
Posts: 43
Joined: Mon Feb 07, 2005 4:55 am

Re: Will 3.1 be handling it's own 404 pages?

Post by Pete77s »

I did not know what to put for subject title, I wasn't looking for support just a bit stumped as to why it behaves like this.
Nicofuma wrote:in fact, you use the url rewriting to hide the app.php file, isn't it ?
I had not turned that feature on until now, but the result is the same.


Is this something worth reporting to bug tracker?

Nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 299
Joined: Sun Apr 13, 2014 1:40 am
Location: Paris

Re: Will 3.1 be handling it's own 404 pages?

Post by Nicofuma »

If you have the url rewriting enabled on your server, this rule is activated by default. (but if the url leads to a valid file or directory it is not rewritten)
Member of the phpBB Development-Team
No Support via PM

User avatar
Pete77s
Registered User
Posts: 43
Joined: Mon Feb 07, 2005 4:55 am

Re: Will 3.1 be handling it's own 404 pages?

Post by Pete77s »

I'm aware of this. Just never had a problem with mod_rewrite like this before. RewriteEngine on is not so much a problem. I need it on for other reasons not just for phpbb.



I appreciate the input though

User avatar
Volksdevil
Registered User
Posts: 84
Joined: Tue Sep 04, 2012 2:17 pm
Contact:

Re: Will 3.1 be handling it's own 404 pages?

Post by Volksdevil »

Just wanted to put my input here as I started another topic that's more 'Generalised' at https://area51.phpbb.com/phpBB/viewtopi ... 08&t=45999 regards error pages.
I've noticed in RC2 that an incorrect address leads to a general information message like so:
Information

No route found for "GET /ExampleIncorrectPage.php"
Can I suggest a small language change to something like the following if even possible?
Information

No route found for "GET /ExampleIncorrectPage.php".
Please return to [SITENAME]. <!-- IF_SEARCH_ENABLED -->Or try the [SEARCH].<!-- ENDIF -->
[SITENAME] and [SEARCH] obviously linked to correct places. In fact, even phpbb.com itself suggests a 'Search' on error pages.

The language could be added to the 'Topic does not exist' and 'Forum does not exist' error messages too?
I've created custom error pages on my 3.0.12 site so I guess I'm just used to seeing a little more information than the current RC2 setup...

User avatar
MichaelC
Development Team
Development Team
Posts: 889
Joined: Thu Jan 28, 2010 6:29 pm

Re: Will 3.1 be handling it's own 404 pages?

Post by MichaelC »

All urls that don't hit a file match app.php which then sends responses. I guess we should add a controller/page for 404 handling, if not an extension could do it. See http://symfony.com/doc/current/componen ... tion-event for how or create a route to match /.? and set it to allow / in the url, send that to a controller, make sure it's the lowest priority, then make that controller throw a 404 template and 404 headers.

You could also look at symfony/TwigBundle internals for twig.exception_controller (Symfony\Bundle\TwigBundle\Controller\ExceptionController if I recall correctly)
Formerly known as Unknown Bliss
psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
No unsolicited PMs please except for quotes.

User avatar
Pete77s
Registered User
Posts: 43
Joined: Mon Feb 07, 2005 4:55 am

Re: Will 3.1 be handling it's own 404 pages?

Post by Pete77s »

Thing is, it happens with files that have not-a-thing to do with phpbb software. Gonna wait a bit longer maybe it'll get taken are of down eh road, but thanks I'll look into that link you put up.

Post Reply