AWS s3 forces 302 to redirect when url doesn't have trailing slash - 301s needed

I am migrating a Wordpress site to a static site hosted in an Amazon s3 bucket. All pages are in a directory structure (e.g. blog / index.html), but can be accessed via / blog /.

By default, Amazon redirects URLs that are not in the final braids through a 302 redirect (www.site.com/page -302-> www.site.com/page/). This is terrible for SEO, and I'm trying to do these 301 redirects.

I tried adding page.html objects to the root directory and setting up redirection to / page / per Amazon. This creates only 301 for /page.html./page still calls 302.

Amazon redirection instructions: http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html

Corresponding blog post: http://moz.com/community/q/new-static-site-with-302s

Has anyone come across this or had any ideas what can I do?

+4
source share
1 answer

According to the docs , it's really their design to return 302:

... If you excluded the trailing slash from the previous URL, Amazon S3 first looks for the object photosin the bucket. If the object photosis not found, it looks for the index document photos/index.html. If this document is found, Amazon S3 returns a message 302 Foundand points to a key photos/. For subsequent requests photos/, Amazon S3 returns photos/index.html. "

, page.html, page ( .html). , URL-, , , Amazon .

+3

All Articles