Hi,
i want design 404 page in my project and i have use culture root ,
my startup
app.Use(async (context, next) => { await next(); if (context.Response.StatusCode == 404) { context.Request.Path = "fa/error_404"; await next(); } }); app.UseEndpoints(endpoints => { endpoints.MapControllers(); endpoints.MapControllerRoute( name: "areas", pattern: "{area:exists}/{controller=Home}/{action=Index}/{id?}"); endpoints.MapControllerRoute( name: "default", pattern: "{culture=fa}/{controller=Home}/{action=Index}/{id?}"); });
[Route("/error_404")] [Route("{culture}/error_404")] public async Task<IActionResult> AboutUs() { return View(); }
my default url is /fa
but when i search a not exsits url for example /fa/Jfejsfd its not got error_404 action and return not found