Add 404 page

Some rework Robots.txt
BugFixes controllers
This commit is contained in:
Дмитрий Шиманский
2023-10-22 15:44:06 +03:00
parent e4537fe81e
commit 76208767b2
7 changed files with 216 additions and 4 deletions

View File

@@ -14,13 +14,19 @@ namespace yaflay.ru
}
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
services.AddControllers()
.AddRazorPagesOptions(options =>
{
options.Conventions.AddPageRoute("/RobotsTxt", "/Robots.txt");
options.Conventions.AddPageRoute("/ErrorPage", "/404");
});
services.AddRouting();
services.AddRazorPages();
services.AddMvc()
.AddRazorPagesOptions(options =>
{
options.Conventions.AddPageRoute("/robots.txt", "/RobotsTxt");
options.Conventions.AddPageRoute("/RobotsTxt", "/Robots.txt");
options.Conventions.AddPageRoute("/ErrorPage", "/404");
});
//services.AddDirectoryBrowser();