【发布时间】:2017-05-08 05:37:30
【问题描述】:
我有一个简单的 ASP MVC 项目。 在此站点下,我需要显示纯 .html 文件,而不将路由视为 controller/action。
我有一个文件夹 documentation,里面有文件 index.html。 我需要在 www.mydomain.com/documentation 下访问它,它返回 403。 目前它仅适用于 www.mydomain.com/documentation/index.html
我已经添加了
routes.Ignore("developers/");
转入RouteConfig.cs
在Startup.cs 中用于 OwinAppBuilder
app.UseStaticFiles();
我应该怎么做才能在 www.mydomain.com/documentation/index.html 下访问它?
【问题讨论】:
-
您能否提供其他静态文件,例如 .js 和 .png?另外你运行的是什么版本的 IIS?
-
也不是核心?对于核心,请参阅:stackoverflow.com/a/41093539/240564
-
好吧,我实际上可以显示文件,问题是我需要将“index.html”显式写入 URL...当我禁用所有 MVC 并让网站运行时,一切正常跨度>
标签: c# html asp.net asp.net-mvc static-files