【问题标题】:Angular PathLocationStrategy issue in s3 buckets3 存储桶中的 Angular PathLocationStrategy 问题
【发布时间】:2018-02-06 06:55:01
【问题描述】:

当我重新加载页面时在 PathLocationStrategy 上,然后找不到 404 页面。而且我不想使用 HashLocationStrategy。

【问题讨论】:

  • 请添加有关您的问题的其他信息。
  • ex.www.example.com/page1 所以当我重新加载时出现 404 错误。

标签: angular serverless serverless-architecture s3-bucket


【解决方案1】:

s3static web hosting下复制redirection rule

<RoutingRules>
  <RoutingRule>
    <Condition>
      <HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals>
    </Condition>
    <Redirect>
      <Protocol>http</Protocol>
      <HostName>Copy Endpoint Link under static web hosting</HostName>
      <ReplaceKeyPrefixWith>#/</ReplaceKeyPrefixWith>
    </Redirect>
  </RoutingRule>
</RoutingRules>

检查我的这个答案,你也需要对角度代码进行一些更改

AngularJS $routeProvider doesn't route properly

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-05-13
    • 2018-09-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多