views:

115

answers:

1

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: 

Hello, Not really no. There isn't an inbuilt feature which allows this, however, what you can do is to create your object and even if you don't save it as HTML, you can apply it as an HTML file.

For example:

Ahhh I don't know how to include HTML text as code.

Look at this page here: View the source on it quickly.

view-source:http://carltonbale.com.s3.amazonaws.com/distance_chart.png

You can see an explaination here:

Point 8: http://carltonbale.com/9-hidden-features-of-amazon-s3

Laykes
I forgot to mention that you would actually then create a header tag in the HTML which redirects.
Laykes
I'd prefer if i could redirect in the header before the html is loaded. I know it's possible to change headers for Content-Type for example but can i also set a redirect header? Something like this:HTTP/1.1 301 Moved PermanentlyLocation: http://www.example.org/Content-Type: text/htmlContent-Length: 174
Martin
Hmm didn't know that multilines was disabled in comments. See edited question instead.
Martin