作为Amazon S3兼容服务,目前我们可以处理虚拟托管式请求。此外,我们也想支持传统的路径风格,例如请求(来自亚马逊):
DELETE /mybucket/puppy.jpg HTTP/1.1
User-Agent: dotnet
Host: s3.amazonaws.com
Date: Tue, 15 Jan 2008 21:20:27 +0000
x-amz-date: Tue, 15 Jan 2008 21:20:27 +0000
Authorization: AWS 0PN5J17HBGZHT7JJ3X82:k3nL7gH3+PadhTEVn5EXAMPLE
我想将请求转换为虚拟托管样式,如下所示:
DELETE /puppy.jpg HTTP/1.1
User-Agent: dotnet
Host: mybucket.s3.amazonaws.com
Date: Tue, 15 Jan 2008 21:20:27 +0000
x-amz-date: Tue, 15 Jan 2008 21:20:27 +0000
Authorization: AWS 0PN5J17HBGZHT7JJ3X82:k3nL7gH3+PadhTEVn5EXAMPLE
如何实现?有人建议我可以使用Apache mod_rewrite,但目前看起来很复杂,我希望有人可以帮忙......
感谢。