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
A 301 signals a permanent redirect from one URL to another, meaning all users that request an old URL will be automatically sent to a new URL. A 301 redirect passes all ranking power from the old URL to the new URL, and is most commonly used when a page has been permanently moved or removed from a website.
There are two parts to masking your S3 url, the first is creating and naming a bucket in S3 to match the subdomain, the second is creating the subdomain and pointing it to the S3 bucket url.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With