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.