404handler icon indicating copy to clipboard operation
404handler copied to clipboard

Infinite redirect when using [BVNetwork.NotFound.Core.NotFoundPage.NotFoundPage] Attribute

Open KidMojo opened this issue 4 years ago • 3 comments

I am using the [BVNetwork.NotFound.Core.NotFoundPage.NotFoundPage] attribute on our ErrorPage controller action in Episerver 11 so that the response type is 404 instead of 200. However, when I use this attribute, it causes an infinite redirect. In our web.config we are using errorMode="Custom" existingResponse="Replace" for httpErrors. What could be causing the infinite redirects? If I manually set the response type to 404 instead of using the attribute, I still get the infinite redirects. It seems like 404 handler is catching the 404 error again and again.

KidMojo avatar Jul 15 '20 17:07 KidMojo

@KidMojo What version of 404 handler are you using?

marisks avatar Aug 03 '20 07:08 marisks

Hey @marisks , Can't believe I just found this. We are also annotating our controller with the not found attribute and our 404 pages are stuck in a redirect loop. We've just pushed version 11.4.0 into production and discovered this. Very odd as we are not seeing the same issue on inte or prep! Any thoughts on what could be causing this?

AlexB-Adv avatar Jun 22 '21 15:06 AlexB-Adv

With the help of EPiServer support we managed to fix our issue. The resolution was to remove all custom redirects, clean up the exported xml (in terms of removing a load of unneeded / old entries) and importing the result into the manager. We went from 5003 custom redirects down to 4427 and everything is working again now.

AlexB-Adv avatar Jun 25 '21 15:06 AlexB-Adv