I'm uploading Gatsby static built files to s3 static website hosting in subdir.
For example.
test.s3-website-us-west-2.amazonaws.com/site1 test.s3-website-us-west-2.amazonaws.com/site2
So I want to access site 1 using url test.s3-website-us-west-2.amazonaws.com/site1 this open frontpage of that site. It works fine till here. But frontpage contains some urls like http://test.s3-website-us-west-2.amazonaws.com/site1/new-post. When I click on link http://test.s3-website-us-west-2.amazonaws.com/site1/new-post the url returns 404 and Url redirects to http://test.s3-website-us-west-2.amazonaws.com/new-post causing it to 404. How we can fix on s3 end is any way to fix on s3 end only or only proxy and Cloudfront is option?
Can we fix using s3 redirect rule?