error404 not working with media items or pdf extension
Hi All,
I noticed that the custom errors dont work from media items.
Are maybe this is regated to certain extensions.
For example.
I have custom errors set for error404 in the UmbracoSettings.config. If I enter a wrong URL then this redirects to my 404 page ok.
But them when I enter a bugus URL with a .pdf on the end then the redirect doesn't work and I am still presented with the generic IIS 404 - File or directory not found error screen which I am trying to avoid for a vulnerability scan.
Any idea how to get the error404 config working for everything including PDFs?
Sorry I forgot to mention this was for Umbraco 8.
Anyway I figure this out.
I could not for the liufe of me figure out a solution using the standard Umbraco config. It just didn't handle certain extensions like .pdf and a few others.
Instead I create some IIS rules to handle the errors.
This seemed to work.
error404 not working with media items or pdf extension
Hi All,
I noticed that the custom errors dont work from media items. Are maybe this is regated to certain extensions.
For example. I have custom errors set for error404 in the UmbracoSettings.config. If I enter a wrong URL then this redirects to my 404 page ok.
But them when I enter a bugus URL with a .pdf on the end then the redirect doesn't work and I am still presented with the generic IIS 404 - File or directory not found error screen which I am trying to avoid for a vulnerability scan.
Any idea how to get the error404 config working for everything including PDFs?
I added the check below in my startup.cs in the section where I add some response headers, that should catch any 404 (/error404 is my umbraco page)
Hi Huw,
Sorry I forgot to mention this was for Umbraco 8. Anyway I figure this out.
I could not for the liufe of me figure out a solution using the standard Umbraco config. It just didn't handle certain extensions like .pdf and a few others.
Instead I create some IIS rules to handle the errors. This seemed to work.
yes that's what you need to do, basically because they are considered to be static files so the error comes from IIS not Umbraco
is working on a reply...