Localhost:1313 instead of Domain on subpages!

Hello!

I’m having problems with my Hugo Website.
The issue is that on my website (jakubwieloch.com) the main page & tag page point to my domain but all the other “subpages” like my blog point to localhost:1313/path/to/content instead of domain/path/to/content. I have my baseURL set to my domain in the config.

After some Reverse Engineering I found that in the build website’s subpages html file, like I said it points to localhost instead of the domain. Also when I changed the title in my config, which also is displayed in the top right corner like here with the Hugo on its forum, the change didn’t happend on those subpages, which indicates that somehow or somewhat all subpages have the domain problem & the not applying changes issue which most likely causes the domain issue. Other than that my search & reverse engineering was unsuccessful.

I’m using Papermod as my theme, using Hugo Version: v0.128.2+extended on Debian Testing (Linux) & deploying my Website through Cloudflare Pages.

I also tried it different hugo versions mainly v0.112.4 & v0.131.0, but the issue stays.

If you want to take a look at the code I have my site’s code over on GitHub, so let me know if you found something.
Have great Day!

I suppose you build your site using hugo server which is for testing purposes. So you can view changes locally at localhost:1313

Therfore it uses that as baseURL.

To get the real result use the command without server.

hugo

Check the generated pages in public/ folder and you will see your domain url

Yes,

I was using Hugo server while creating these pages as a live preview, but the hugo command is automatically run (on cloudflare) when I push new content/changes to my Github, even if I do a “manual” build with the hugo command, the issue is still present (because essentially it’s doing the same).
The issue is with the built website!

I would really suggest you to view my website & go to either “Product” or “Blog”, and then try navigating even back to the main page. You will see what the problem is which I already describe in my first post.

Mmh. Then I would rather sugest check your cloudflare build and deploy. :slight_smile:

The site published in the intrrnet is generated using hugo server not hugo

Use view source in your browser and you will see the livereload javascript loaded which is only injected by the server call.

So either the build call is wrong or you have committed your public folder and this is deployed as is. Or a combination of both :wink:

2 Likes

Hello everyone, who might experience this problem or just came this thread.

After 8 Months of having this issue I’ve fixed it.

I would like to say you how I fixed it but I don’t know to this day, at least not for sure what it caused.
My speculation was that I made many small & minor mistakes that ended in a Massaker.
You can Look at my Github, I fixed it on March 10 2025, but should anything happen to my repo or link here’s the:

TL;DR: Solution

  • Check your Cloudflare deployment & build setting/flags! (Especially stuff like cache :eyes:)
  • If pages of your website are missing: use _index.md instead of index.md and read this!
  • Question everything…

P.S: Just watch out and revisit if you really didn’t do syntax mistakes, false deployment or anything else! BTW, I’ve used hugo server in my Cloudflare before I’ve solved the Issue like I said 8 f… Months ago.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.