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

32
Pages/ErrorPage.cshtml Normal file
View File

@@ -0,0 +1,32 @@
@page
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page not found</title>
<link rel="shortcut icon" type="image/png" href="#">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/404.css" />
</head>
<body>
@{
string path = $"{this.Request.Scheme}://{this.Request.Host}";
}
<div class="error">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-7 text-center">
<img src="~/img/error-404.png" alt="image 404">
<h2><b>404</b> Страница не найдена</h2>
<p>посетите главную страницу <br> возможно вы найдёте её</p>
<a href="@path" class="cmn-btn mt-4">На главную</a>
</div>
</div>
</div>
</div>
</body>
</html>

12
Pages/ErrorPage.cshtml.cs Normal file
View File

@@ -0,0 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace yaflay.ru.Pages
{
public class Index1Model : PageModel
{
public void OnGet()
{
}
}
}

View File

@@ -3,7 +3,7 @@
Layout = null;
this.Response.ContentType = "text/plain";
}
# /robots.txt file for http://www.hanselman.com/
# /Robots.txt file for httpы://yaflay.com/
User-agent: *
<environment include="Development,Staging">Disallow: /</environment>
<environment include="Production">Disallow: /* </environment>