Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • croban 25 posts 96 karma points
    Apr 22, 2022 @ 14:34
    croban
    0

    Is it there any possibility to have custom static notfound.cshtml inside Umbraco 9?

    Is there any possibility to have custom "notfound.cshtml" per default? Can not do anything to have my own "notfound.cshtml" static. I know there is the way over umbraco to create custom DocType notfound inside CMS and define it as 404er.

    It does not matter what I do, on 404 always comes result from umbraco/UmbracoWebsite/NotFound.cshtml file

    This is my Pipe:

    if (!context.HostingEnvironment.IsEnvironment("Production"))
    {
        app.UseDeveloperExceptionPage();
    }
    else
    {
        app.UseExceptionHandler("/Error/500");
            //Issue https://github.com/umbraco/Umbraco-CMS/issues/11851
            //app.UseStatusCodePagesWithReExecute("/Error/{0}");
    }
    
    app.UseHttpsRedirection();
    
    app.UseUmbraco()
       .WithMiddleware(u => {
        u.UseBackOffice();
            u.UseWebsite();
       })
       .WithEndpoints(u => {
        u.UseInstallerEndpoints();
            u.UseBackOfficeEndpoints();
            u.UseWebsiteEndpoints();
       });
    
    app.UseStaticFiles(new StaticFileOptions() ...
    app.UseSpa(spa => ...
    

    Does anyone knows why this does not works or what am I doing here wrong?

Please Sign in or register to post replies

Write your reply to:

Draft