Ich habe eine robots.txt, die nicht statisch sondern dynamisch generiert wird. Mein Problem besteht darin, eine Route von root/robots.txt zu meiner Controller-Aktion zu erstellen.Wie Route zu dynamischer robots.txt in ASP.NET MVC hinzufügen?
Diese arbeitet:
routes.MapRoute(
name: "Robots",
url: "robots",
defaults: new { controller = "Home", action = "Robots" });
Diese nicht funktioniert:
routes.MapRoute(
name: "Robots",
url: "robots.txt", /* this is the only thing I've changed */
defaults: new { controller = "Home", action = "Robots" });
Die ".txt" verursacht ASP hier offenbar