create your content page called error404 and then use it's id in the umbraco config, that is basically it, or at least that is all I have done and it works fine.
since I don't know how your site works it is a bit difficult to give you an exact answer, you will need to add some other parameter to the xpath to get the exact one or If it is culture based you could add a 404 setting for each culture as shown in the settings config file
$site gets the relative root, then my path is /Special-Pages/Page-Not-Found, where Special-Pages is a "contentFolder" document type, and Page-Not-Found it a "page" document type.
Custom 404
I've followed the instruction in https://our.umbraco.com/documentation/tutorials/Custom-Error-Pages/ to update the umbracoSettings.config file with my error page.
It works with a page ID or GUID but not with a page URL.
How do I redirect to /error404/
Thanks
create your content page called error404 and then use it's id in the umbraco config, that is basically it, or at least that is all I have done and it works fine.
As per my OP I want to use a page URL not a page ID.
it requires either an id, a guid or an xpath,
Why do you need to use a url when it already has a perfectly good working way of doing it
Because it's a multi site and each site has a custom /error404/
I wanted to use an xpath but the example doesn't work or any variation I tried.
could you show us the xpath you are using then, I would imagine that is where the issue is.
I don't understand the example given:
I tried my url and I tried substituting my page url in the @nodeName='/error404/'
It should work using xpath, this is what I have just tested in place of my ID
customErrors is the document type and Error404 is my 404 document
Unfortunately that doesn't display the relevant site's 404 page.
The 404 page from site 1 is always displayed.
since I don't know how your site works it is a bit difficult to give you an exact answer, you will need to add some other parameter to the xpath to get the exact one or If it is culture based you could add a 404 setting for each culture as shown in the settings config file
ok thanks. I'll try to find out.
Did you find a solution ?? Have the same issue
Let me add that I have the same issue, 3 years later.
No solution I guess? Implementing your own custom error handler?
As of 8.16, you should be able to use the $site in the error xpath path to specify the requested site. Eg $site//errorPage
https://github.com/umbraco/Umbraco-CMS/issues/10354
Before 8.16, you either need to manage it yourself if you have multiple sites. Probably by using a custom content finder.
https://our.umbraco.com/documentation/Reference/routing/request-pipeline/IContentFinder
Here is how I was able to acheive a multi-site 404 page within the content tree:
$site gets the relative root, then my path is /Special-Pages/Page-Not-Found, where Special-Pages is a "contentFolder" document type, and Page-Not-Found it a "page" document type.
I'd like to add, for those that don't know, this is within 'Umbraco > Cms > Content'
This is configured in the configuration values set in the code.
Which code file its set in depends on the version.
It's either in the UmbracoSettings.config for version 7 and 8. For more details see the error page guide,
Or in the appsettings.json on version 9 and above.
is working on a reply...