由网友(Sorry丶我不是警察)分享简介:是否有可能把一个重定向头在S3对象?像301重定向。例如:mybucket.amazon-aws.com/myobject - > example.com/testpreferably通过设置一个标题是这样的对象:HTTP / 1.1 301永久移动地点:http://example.com/test内容类...
是否有可能把一个重定向头在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.
相关推荐
最新文章