1

I have an EpiServer 7 site, that I am trying to wire up a custom 404 page to.

I solution works fine when running locally. When I deploy to the staging server (site not get live), it takes 2-3 minutes to display my 404 page. If I log onto the server, and run the same URL, I get the custom 404 page displaying right away?

My entry inside web.config is (inside ):

    <httpErrors errorMode="Custom" existingResponse="Replace">
  <clear />
  <error statusCode="404" responseMode="ExecuteURL" prefixLanguageFilePath="en" path="/system/pagenotfound/" />
</httpErrors>

Any ideas?

mp3duck
  • 2,633
  • 7
  • 26
  • 40

2 Answers2

1

I had the same kind of issue, do you have a custom route mapping? Like:

 protected override void RegisterRoutes(RouteCollection routes)
 {
        routes.MapRoute("404", "404", 
            new { controller = "ContentPage", action = "NotFound" });

        base.RegisterRoutes(routes);
 }

Remove that route and add the following catch all route:

protected override void RegisterRoutes(RouteCollection routes)
{
    base.RegisterRoutes(routes);

    routes.MapRoute("Error", "{*url}",
        new { controller = "ContentPage", action = "NotFound" });
}
Erwin
  • 4,757
  • 3
  • 31
  • 41
1

I met same issue and realize it's because of globalErrorHandling on episerver.config. You should set it to "Off", which I guess on your episerver.config is now "RemoteOnly".

Hope this helps

Dung Le
  • 91
  • 1
  • 2