When I use the hugo multi-language configuration, the baseurl is http://domain.com/blog, but it was redirected to http://domain.com/zh/blog, This results in a 404 error because there is no /zh path.I used GitHub Pages for deploy. How can I configure it?
You are more likely to receive a prompt and accurate response if you post a link to your project’s Git repository.
See Requesting Help.
Let us see your code
Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.
Did you set the baseURL with the first route path?
Another possible hypothesis is that the template is hardcoding paths in links instead of using something like .Permalink.
For GitHub Pages, I prefer setting up the base URL in the GitHub Actions, it’s simpler this way and do not mess with the local environment.