- Newest
- Most votes
- Most comments
S3 redirect only can change prefix which is basically the folder name. The prefix does not contain the file name. So, the way you want to do this is not supported.
The only other option you really have is to upload a zero-byte file with the .aspx
extension that you want redirected to html. You will have to do this for every .html
page you have.
With that you can change the System Metadata to perform a 301
redirect to any other object.
So, say you have a page named /products/myproducts.html
you would upload a zero-byte file named /products/myproducts.aspx
(Note: It really does not have to be zero byte any content will work) In the meta data key of x-amz-website-redirect-location
you will place /products/myproducts.html
Here are the examples on how to do the various rewrite rules if you need additional information.
With CloudFront you might be able to rewrite using lambda edge, but I don't think that would be easy or cost effective.
If your front end is actually a single page application using something angular or react you can do client-side routing and do this in the browser.
i will do the redirection on the client side that was one of the option i was thinking to use. thank for the answer
Relevant content
- asked 2 years ago
- asked a year ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 9 months ago