我有一个web应用程序托pipe在亚马逊S3中,web应用程序使用jQuery Mobile构build,我使用changePage在页面之间导航,当我改变页面时,我没有使用哈希运算符(#)。
当用户复制url并将其粘贴到新标签页时,我遇到了问题
例如:
http://www.exampleurl.com/page1.html
加载只有jquery页面结构在amazon s3页面page1.html …
我想要的行为是加载index.html并用js读取url,检测页面并加载正确的页面。
与Apache我解决这个URL重写…但对于亚马逊S3我没有find任何类似的…
注:我知道,如果我激活哈希运算符(#)在我的url问题已解决,但我需要没有#清洁url。
最后,我在另一个问题中find了解决我的问题的方法:
https://stackoverflow.com/questions/16267339/s3-static-website-hosting-route-all-paths-to-index-html
目标是在redirect规则中使用这个configuration:
<RoutingRules> <RoutingRule> <Condition> <HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals > </Condition> <Redirect> <HostName>yourdomainname.com</HostName> <ReplaceKeyPrefixWith>#!/</ReplaceKeyPrefixWith> </Redirect> </RoutingRule> </RoutingRules>