404 occurred when I use github repo rather than <username>.github.io

Hello everyone in HUGO Community!

I’ve got a problem when I use Hugo and deploy on Github as I mentioned in title.

My Github Repo is: GitHub - 403Unauthorized/hugo, So by default the Github Page will have a suffix “/hugo”.

You can see on the right top, there are three menus. When I click on Posts menu, I got 404 because of the url become like: https://403unauthorized.github.io/hugo/hugo/posts/

The correct url only has one “hugo” in it.

Because I use another repo for Hugo, so I set baseURL with suffix “hugo” . And because of this, all of my images under static folder need to add prefix “hugo”, that’s so annoying.

What can I do to make it work properly?

Thank you,
Best Regards

It looks like you have renamed your repository and edited your site configuration since you posted this issue. Are you still having a problem, or is this issue resolved?

Hello @jmooring,

Yes I’ve renamed my repository and edited the configuration since I couldn’t resolv the issue by myself in a short time.

But the thing is, I want to host another website on Github, there must be same as former issue.

Could you please share a configuration that url uses a prefix like “xxx.github.io/learn” and I can access to all other resources even if the prefix exists.

That would be much appreciative!

Best regards,
403Unauthorized

No.

It is complicated and depends on:

  • Your theme
  • Template overrides
  • Render hooks
  • Configuration
  • Markdown (how you create images and links)

Please post again when you have a specific example with a public repository.