From 08f22fa495c903f048b704e2a33190139f685b23 Mon Sep 17 00:00:00 2001 From: jocloud Date: Thu, 21 May 2020 15:45:45 +0000 Subject: [PATCH] =?utf8?q?robots.txt=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- ZipProject/Controllers/WebZipController.cs | 16 ++++++++++++++++ ZipProject/wwwroot/robots.txt | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ZipProject/Controllers/WebZipController.cs b/ZipProject/Controllers/WebZipController.cs index 6515545..9b2ff8e 100644 --- a/ZipProject/Controllers/WebZipController.cs +++ b/ZipProject/Controllers/WebZipController.cs @@ -155,6 +155,22 @@ namespace ZipProject.Controllers return File(file, content_type, "sitemap.xml"); } + [HttpGet("/robots.txt")] + public IActionResult Robots() + { + string path; + string content_type= "text/plain"; + +#if !DEBUG + path = Environment.CurrentDirectory + "/release/netcoreapp2.1/publish/wwwroot/robots.txt"; +#else + path = Environment.CurrentDirectory + "/wwwroot/robots.txt"; +#endif + + byte[] file = System.IO.File.ReadAllBytes(path); + return File(file, content_type, "robots.txt"); + } + } } \ No newline at end of file diff --git a/ZipProject/wwwroot/robots.txt b/ZipProject/wwwroot/robots.txt index 82a2142..4dbdb6d 100644 --- a/ZipProject/wwwroot/robots.txt +++ b/ZipProject/wwwroot/robots.txt @@ -1,4 +1,4 @@ User-agent: * Allow : / -Sitemap: https://nicezip.wabiey.com/sitemap.xml \ No newline at end of file +Sitemap: https://nicezip.kr/sitemap \ No newline at end of file -- 2.43.0