Why is a trailing slash added to the URL when I use Amazon S3 static website redirection feature?
I am using the Amazon Simple Storage Service (Amazon S3) static website redirection rules. Amazon S3 adds a slash at the end of the URL that breaks my website.
"I am using the Amazon Simple Storage Service (Amazon S3) static website redirection rules. Amazon S3 adds a slash at the end of the URL that breaks my website.ResolutionThe addition of a trailing slash to the redirected URL is an expected behavior with the Amazon S3 static website hosting feature.To avoid the addition of a trailing slash in the redirected URL, you can use the following workaround:Configure an index document (example: index.html) to host the S3 static website.Set the website redirect location in the metadata of the object to configure the redirect.To perform the workaround, complete these steps:Open the Amazon S3 console.From the Buckets list, choose the name of your bucket.Choose Properties.Under Static website hosting, choose Edit.On the Edit Static website hosting page, for Static website hosting, choose Enable.For Hosting type, select Host a static website.For Index document, specify the name of an object that you want to use to set the redirection metadata. Example: index.htmlDelete the Redirection rules, if any. Choose Save changes.Next, use the S3 console to configure an index. Then, complete these steps to configure the redirect:Open the Amazon S3 console.From the Buckets list, choose the name of your bucket.Under Objects, choose the index document that you configured.Choose the Properties tab.In the Metadata section, choose Edit.Under Metadata, do the following:Choose Add metadata.For Type, select System defined.For Key, choose x-amz-website-redirect-location from the dropdown list.For Value, enter the redirect URL (Example: http://www.example.com). Choose Save changes.Related informationConfiguring a webpage redirectFollow"