I deployed my first Hugo site to Netlify and, while the top level of the site loads, trying to load any of my indivdual posts results in an endless loop of trying to load the page without success.
I am not sure where to start to diagnose the problem. My website works OK locally on the test server. I setup my Netlify account and built the site without error. Address: circuidipity.netlify.com
But if I click on any of my posts the browser enters an endless loop of trying and failing to load the page. Does anyone have any insight to offer on this? Is there any log or test that I can run to perhaps shed more light on the issue? Thanks in advance for any help!
You ought to link to your siteās source, so we can see how the ocnfig and site are set up. Always do that when seeking help.
Have you asked Netlify about this? I donāt see any reason Hugo would be causing a loop, but DNS and redirects are almost always the culprit. Also, because your local site works elsewhere, something about Netlify is probably interacting with the DNS oddly.
Your posts have aliases set for them. It is creating double the amount of files, but also creating files that conflict with {post}/index.html page rendering.
I honestly donāt know if that is the issue, but Iād try removing that from a post, push the changes and check.
And a question: why do your posts have aliases set for them?
Netlify has their own way of doing redirects. Iād drop all the aliases in front matter, and instead create _redirects for all your old URLs. You can probably figure it out with a single rule and :splat to construct yer redirect.
Or, ya know, donāt worry about it. You only got like 70 pieces of content. It will get reindexed quickly, and you can put a mention on the 404 about it or something.
I would do anything aside from using aliases for your specific case, because it doubles the amount of content files youāve got, and I donāt know, that just annoys me. Letās keep those files down!
You can search the forums, there are a bunch of Netlify and alias conversations. Let me know how it goes.
@maiki I removed the aliases from the front matter and created a _redirects file as per the Netlify HOWTO, and all the posts and pages are now loading OK! Thanks so much for your help.
Iām posting this here because I had a similar issue with aliases and Netlify doing an endless loop, and removing them did indeed fix the problemā¦ except:
Once I deployed to netlify with the aliases, it was very hard to get netlify to stop redirecting this. Clearing cache worked sometimes, but not always. Even reverting to a pre-Hugo version of my site would cause my pages (i.e. ā/faq/ā to display nothing but Redirecting to /faq).
What finally fixed this for me, was to turn on āPost-processing > Asset Optimizationā in Netlify with all the settings (including āPretty URLsā).