相关疑难解决方法(0)

在页面刷新时使用Angular JS ui.router html5Mode(true)配置Amazon S3静态站点

如何配置Amazon S3静态网页以正确路由Angular ui.router html5Mode路由?在页面刷新时,它将请求不存在的文件,而angular不能处理它.在文档中,他们建议您更改服务器上的URL重写.

https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions#how-to-configure-your-server-to-work-with-html5mode

但是,S3是存储,并且不提供我尝试使用内置重定向规则的相同重定向选项,例如

<RoutingRules>
    <RoutingRule>
        <Condition>
            <HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals >
        </Condition>
        <Redirect>
             <HostName>[[ your application's domain name ]]</HostName>
             <ReplaceKeyPrefixWith>#/</ReplaceKeyPrefixWith>
        </Redirect>
    </RoutingRule>
</RoutingRules>
Run Code Online (Sandbox Code Playgroud)

但是,这只会导致重定向循环.

有什么建议?

html5 amazon-s3 angularjs angular-ui-router

13
推荐指数
1
解决办法
8861
查看次数

标签 统计

amazon-s3 ×1

angular-ui-router ×1

angularjs ×1

html5 ×1