This all works fine when it is a page being requested that does not exist. This does not work however if the user is trying to access a PDF or some other file that does not exist.
How do you go about handling such cases and redirecting to an appropriate error page?
You should be able to add a setting in your Web.Config file that will be the response for all HTTP requests that return a status code of 404. It would look something like the following:
Custom 404 Page
Hello,
I have setup custom error pages following the details in the link below:
https://our.umbraco.org/wiki/install-and-setup/configuring-404-pages
This all works fine when it is a page being requested that does not exist. This does not work however if the user is trying to access a PDF or some other file that does not exist.
How do you go about handling such cases and redirecting to an appropriate error page?
Thanks.
Hi Graham,
You should be able to add a setting in your Web.Config file that will be the response for all HTTP requests that return a status code of 404. It would look something like the following:
You should be able to use an Umbraco page url as the path too if you wish to use the same page.
Gary
The following actually solved my situation...
...simply adding existingResponse="Replace" errorMode="Custom" as attributes to the httpErrors element.
All credit provided by the following post: https://stackoverflow.com/a/6661699/957186
This is my second time posting this in the last few minutes :-D
Try the steps in Morten Sørensen's blog below. These steps worked for me.
https://blog.mortenbock.dk/2017/02/03/error-page-setup-in-umbraco/
(PS Thanks Morten)
What about this ? Custom 404 in Umbraco 7
is working on a reply...