【问题标题】:robots.txt file in Angular application hosted with .Net Core使用 .Net Core 托管的 Angular 应用程序中的 robots.txt 文件
【发布时间】:2018-05-28 05:18:56
【问题描述】:

我托管了一个使用 Angular 5 服务器端渲染构建并托管在 Windows 服务器上的 .Net Core 中的 Web 应用程序。我已经在服务器的根目录中上传了一个 robots.txt 文件。但是,当我尝试浏览 https://sample.com/robots.txt 时,它不会加载文件。

我感觉 Angular 试图解析 URL 而不是服务器。请指教。

【问题讨论】:

  • 您在服务器中的哪里提供客户端文件?他们在 wwwroot 中吗?
  • 是的,知道了。感谢您的提醒。现在修好了。
  • 很高兴你明白了。干杯:)

标签: angular asp.net-core-mvc asp.net-core-2.0


【解决方案1】:

正如上面@Arash在评论中提到的,文件应该上传到wwwroot文件夹,而不是服务器的根文件夹。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-04
    • 1970-01-01
    • 2017-11-13
    • 2021-08-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多