Custom 404 page working for all bug .aspx file types
Hi all,
Our custom 404 pages were working for .aspx files using Umbraco's 404 function and for non-aspx files using IIS's 404 function before upgrading from 3.2 to 4.5. Now, only non-aspx 404 errors are working. When I try and navigate to a non-existant .aspx file I get the following error:
Here is how I have the 404 errors set up:
umbracoSettings.config page:
404 error page node:
As you can see, I have told Umbraco where to look, and the page specified does exist.
Can somebody tell me where I am going wrong? Or is it a deeper error...?
thanks for the reply. I put it in the web.config file as a child of <system.webServer>. The .aspx files are acting the same and all other 404 errors now show google chrome's...
Not sure if the above is correct - afaik poet patcher was a patch for an asp security flaw that has since been patched by microsoft so it could be removed...
The non-existing-page.aspx does not exist yet in Umbraco, so it triggers a 404 (because it has the aspx extension) and.. presto: Umbraco handles the 404 perfectly!
Hmm, if I'm right in thinking that the only way to see the umbraco log without having access to the server is by getting a package for umbraco, I'm going to put this error on hold for a while; I still have some xslt issues and am in the middle of several other things and don't want to have a broken website on my hands incase anything goes wrong during the package install.
I will probably get back onto this in the next few days.
Ah, it sucks that you don't have access! Make sure to create a new topic when you get back to this, as you will probably not get many replies to a topic that's already "solved" and I'm not sure I can answer soon enough in a few days :-)
Erm... really unsure how... but I managed to fix it? All 404's now work since I have taken out all of the changes made to the web.config file but left the 404handlers file. I'm very confused, but I suppose I can't complain ^_^
IIS works with a lot of config inheritance. My guess is that your webhost has already set up the custom error handling correctly for you in IIS, so you don't have to overrule it in the web.config. That wouldn't exactly explain the exception, but does explain why it works out of the box! :-)
Custom 404 page working for all bug .aspx file types
Hi all,
Our custom 404 pages were working for .aspx files using Umbraco's 404 function and for non-aspx files using IIS's 404 function before upgrading from 3.2 to 4.5. Now, only non-aspx 404 errors are working. When I try and navigate to a non-existant .aspx file I get the following error:
Here is how I have the 404 errors set up:
umbracoSettings.config page:
404 error page node:
As you can see, I have told Umbraco where to look, and the page specified does exist.
Can somebody tell me where I am going wrong? Or is it a deeper error...?
Thanks,
Max.
I think you need to change this key in your web.config:
It will pass all of the 404 errors through to Umbraco instead of letting IIS handle them.
thanks for the reply. I put it in the web.config file as a child of <system.webServer>. The .aspx files are acting the same and all other 404 errors now show google chrome's...
Oops! This link appears to be broken.
... message
Very odd!
That is indeed really weird, could you try it in IE or Firefox to see what the actual error message is?
IE says 404: the web page cannot be found
The webpage cannot be found
HTTP 404
firefox says "Done" and shows a blank white pace
Very odd...
Hmm, do you have this set to "On"?
What does your 404handlers.config say?
Same 404 error with cutom errors set to on.
404handlers.config:
<?xml version="1.0" encoding="utf-8"?>
<NotFoundHandlers>
<notFound assembly="umbraco" type="SearchForAlias" />
<notFound assembly="umbraco" type="SearchForTemplate" />
<notFound assembly="umbraco" type="SearchForProfile" />
<notFound assembly="Umbraco.PoetPatcher" type="GenericError" />
</NotFoundHandlers>
Not sure if the above is correct - afaik poet patcher was a patch for an asp security flaw that has since been patched by microsoft so it could be removed...
Oh you really don't need the PoetPatcher any more unless your server has not been patched for months.
Replace the last entry:
with:
Hmm, making that change now corrects the .aspx 404 error page but the non .aspx pages still return a 404. Where can I check the page ID for this?
Ah yes, I have it backwards, try this:
<httpErrors errorMode="Custom">
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/non-existing-page.aspx" responseMode="ExecuteURL" />
</httpErrors>
The non-existing-page.aspx does not exist yet in Umbraco, so it triggers a 404 (because it has the aspx extension) and.. presto: Umbraco handles the 404 perfectly!
Perfect :D Thanks for all your help, much appreciated.
Max.
No problem, could you mark my answer as the solution please?
Marked as solution :)
I have implemented the above changes to our live website's files and am now getting a page saying:
The page cannot be displayed because an internal server error has occurred.
Any ideas why this might be happening?
Not sure, what is the REAL error (check the umbracoLog table and the windows event log).
Do you have IIS version 7 on your server as well?
Hmm, if I'm right in thinking that the only way to see the umbraco log without having access to the server is by getting a package for umbraco, I'm going to put this error on hold for a while; I still have some xslt issues and am in the middle of several other things and don't want to have a broken website on my hands incase anything goes wrong during the package install.
I will probably get back onto this in the next few days.
Thanks again for your help :)
Ah, it sucks that you don't have access! Make sure to create a new topic when you get back to this, as you will probably not get many replies to a topic that's already "solved" and I'm not sure I can answer soon enough in a few days :-)
Erm... really unsure how... but I managed to fix it? All 404's now work since I have taken out all of the changes made to the web.config file but left the 404handlers file. I'm very confused, but I suppose I can't complain ^_^
IIS works with a lot of config inheritance. My guess is that your webhost has already set up the custom error handling correctly for you in IIS, so you don't have to overrule it in the web.config. That wouldn't exactly explain the exception, but does explain why it works out of the box! :-)
is working on a reply...