本文介绍了Amazon S3的对象重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能把一个重定向头在S3对象?像301重定向。

例如:

  mybucket.amazon-aws.com/myobject  - > example.com/test
 

preferably通过设置一个标题是这样的对象:

  HTTP / 1.1 301永久移动
地点:http://example.com/test
内容类型:text / html的
内容长度:0
 

解决方案

在过去的一个月中,这个功能刚刚被添加。

您可以在这里找到API文档:

http://docs.amazonwebservices.com/AmazonS3/latest/dev/how-to-page-redirect.html

当你把你的对象,你需要设置 X-AMZ-网站重定向的位置针对该对象到您希望使用301重定向的关键。

您也可以使用控制台。

Is it possible to put a redirect header on a s3-object? Like a 301 redirect.

For example:

mybucket.amazon-aws.com/myobject --> example.com/test

Preferably by setting a header like this on the object:

HTTP/1.1 301 Moved Permanently
Location: http://example.com/test
Content-Type: text/html
Content-Length: 0
解决方案

Within the last month, this functionality has just been added.

You can find the API documentation here:

http://docs.amazonwebservices.com/AmazonS3/latest/dev/how-to-page-redirect.html

When you PUT your object, you need to set the x-amz-website-redirect-location key against that object to the 301 redirect that you wish to use.

You can also use the console.

这篇关于Amazon S3的对象重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 08:02