I have hosted a static NextJS website on amazon S3. The website works fine when the homepage is loaded and then other pages are loaded by nav. But if a particular page(except homepage) is reloaded, the site returns 404.
Also, I have tried putting the error page route back to 'index.html' as suggested on some threads but didn't solve the issue. Instead, after every page refresh, the index page opens.
How do I resolve that when a person is on Page1.html(for example) and he his refresh, Page1.html loads not the homepage.