If not done correctly, that is the default result with Cloudfront + S3. You set the index and error page to your index.html. That way you get SPA routing but a 404 for all non root routes. The author needs to add a Lambda to rewrite the HTTP response depending on the route, some 404s should be rewritten to be 200s.
Last I checked, this was inevitable if you publish a SPA on GitHub Pages, like the author is doing (GitLab not GitHub, but probably similar): https://gitlab.com/utkarsh181/utkarsh181.gitlab.io/-/blob/ma...
There's an open GitLab issue: https://gitlab.com/gitlab-org/gitlab-pages/-/issues/57
Workaround: Publish the artefacts from CI/CD to Netlify or similar, where you can configure URL rewrites.
Re:The ThinkPad P14s
by utkarsh-singh on Tuesday January 09, 2024 @08:24AM
(#38925885)
Yes, you're on spot! Surely, I can try this workaround. Do you have any references for this workaround?
This mostly works, but some browsers will display a warning or their own 404 page. Also it means his site won't be indexed in search engines.