Try our conversational search powered by Generative AI!

500 - Internal Error instead of 404 - Not Found when sufring to an expired page

Vote:
 

Hi:

After an upgrade to the CMS 6 R2 I get "500 Internal Error response" everytime I surf into an expired page. Is this by desing in EPiServer or there is something missconfigured in my installation. I would normaly or would like to get a 404 - Page Not found for all unpublished pages.

When I try surf to a page that does not exist (and never did) I get my expected 404.

I am running my EPiServer in IIS 7.5 and have the following configuration:

<siteSettings globalErrorHandling="Off" />
<httpErrors defaultPath="/Error/DefaultError.aspx" defaultResponseMode="ExecuteURL">
    <remove statusCode="404" subStatusCode="-1" />
    <remove statusCode="500" subStatusCode="-1" />
    <error statusCode="404" path="/404.aspx" responseMode="ExecuteURL" />
    <error statusCode="500" path="/500.aspx" responseMode="ExecuteURL" />
</httpErrors>

 

I cannot recreate the error locally on my machine, therefore I am not able to debug.

I am not sure whether the error is the current configuration of my IIS or my EPiServer site.


Thanks.

#60935
Aug 31, 2012 13:44
Vote:
 

The default behaviour is to redirect the user to the login page. So maybe the error comes from the login page?


So if you want a 404, you have to implement this by yourself.

#60939
Aug 31, 2012 14:26
Vote:
 

Hi Johan, when I was trying to recreate the problem locally I was being redirected to the login url, but in this case it returned 404. I found some differences in the web.config and in the IIS configuration and changed them locally so it was as close as possible to the one in the server. I know get a blank page with the text "Access denied", the status returned is 302 Found. I cannot recreate the 500 error I always get on my server.

It seems that it is now stopped before the login page, if I understand well the access denied comes from the expired page? or from the redirect to the login page? In this case the URL in the browser does not change.

Is this the case, as you mentioned, a problem with the URL?

Do you have any info on how to fix this problem? Any article or documentation will be highly appreciated.

Many thanks.

#60970
Sep 03, 2012 13:13
Vote:
 

Yes in the class PageBase the code throws an access denied. You can override this method and do whatever you want to, e.g. throw a 404.

Regarding the url, it depends on how you have configured the site. In your case you have ExecuteURL in responseMode.

Remove all your error handling to see what's really happening when you try to access the page.

#60982
Sep 03, 2012 16:21
Vote:
 

Thanks for the help Johan, I found the method AccessDenied() in the PageBase, did an override and seems to work fine. Gonna do some further testing but working great so far. Cheers

#61006
Sep 04, 2012 11:15
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.