我的计划是使用单个 Amazon Bucket 进行从 www 域到非 www 的 301 重定向。域。
我希望能够将任何 URL 指向它,并让它不仅在该域上执行重定向,而且还保留directioy 路径:
www.site.com/test -> site.com/test
重定向规则可以在这里找到:http: //docs.aws.amazon.com/AmazonS3/latest/dev/HowDoIWebsiteConfiguration.html
这是一般设置的样子:
RoutingRules> =
<RoutingRules>
<RoutingRule>...</RoutingRule>
[<RoutingRule>...</RoutingRule>
...]
</RoutingRules>
<RoutingRule> =
<RoutingRule>
[ <Condition>...</Condition> ]
<Redirect>...</Redirect>
</RoutingRule>
<Condition> =
<Condition>
[ <KeyPrefixEquals>...</KeyPrefixEquals> ]
[ <HttpErrorCodeReturnedEquals>...</HttpErrorCodeReturnedEquals> ]
</Condition>
Note: <Condition> must has at least one child element.
<Redirect> =
<Redirect>
[ <HostName>...</HostName> ]
[ <Protocol>...</Protocol> ]
[ <ReplaceKeyPrefixWith>...</ReplaceKeyPrefixWith> ]
[ <ReplaceKeyWith>...</ReplaceKeyWith> ]
[ <HttpRedirectCode>...</HttpRedirectCode> ]
</Redirect>
Note: <Redirect> must has at least one child element.
Also, you can have either ReplaceKeyPrefix with or ReplaceKeyWith,
but not both.
我会将我的 www CNAME 指向这个存储桶。我的问题是,鉴于亚马逊为我们提供的桶重定向控制,这可能吗?