Customize "Page Not Found" page


For Neos password protected pages. When the login session is expired, users get a “Page Not Found” page. How do I customise this to include a log in form?


1 Like

I didn’t test it yet, but I recently stumbled upon and it might help you

You can use and point to “login” instead of “404” if you like.

However it can’t differentiate between the page actually not existing and when a page cannot be accessed due to restrictions. That would require some custom code to achieve. You could fork the package and add the logic to it.

FYI: The fact that inaccessible & non-existing behaves the same was done on purpose in order to prevent information disclosure. Working around that might have an impact on the security of your system

1 Like

How exactly it can point to login ? I am also using the package but I want to point to the page with URL segment to /notfound and I am struggling with the settings.yaml

I have the following settings in my Project/Configuration/Settings.yaml
path: ‘404-2’

Error -> No controller could be resolved which would match your request.

I have the same problem at the moment.
(Using Neos v7.0.1)
I configured my Settings.yaml with:

                          matchingStatusCodes: [404]
                                  path: '404

And the error:

Seite nicht gefunden

Die angeforderte Seite konnte nicht gefunden werden.

#1303209195: No controller could be resolved which would match your request. Package key: “”, controller name: “Standard”. (GET http://localhost:8081/de/digitalergerg)

Is there any solution to this? I can’t find a proper way in the docs to handle Custom 404 Error pages, besides this link:

Where it only says:

By extending the error case you can add custom 404 rendering like in the example below.

But there are no examples.

Hi Daniel,

seems the code example was cut by doc generator. But you can find a current example in the Neos.Demo site

It’s working now, but it took some more configuration (the following files):


And adding the following to /Configuration/NodeTypes.Document.HomePage.yaml

          type: 'Package.Name:Document.NotFoundPage'

Futherone, I changed something in Error.fusion:

@context.notfoundDocument = ${q(site).children('[instanceof Neos.Neos:Document]').filter('[uriPathSegment="notfound"]').get(0)}

Hope this helps other people with the same problem.

Hi Daniel,

great to hear it works for you now. I recommend to make the notfound page as autogenerated childnode of your homepage type (like in the Demo). This way you can use the original query again and editors cannot accidentally break the page by moving or changing the uriPathSegment.

For handling properly the i18n case, for example /fr/some/non-existent-page should return a French version of the NotFound page, I used the code provided here: which worked for me.

The Neos.Demo NotFound Error Handling seems just to handle one language dimension as far as I understand. Do I understand it correctly @sebobo ?

Hi Oliver, yes.

Could be improved though.