About the recent redirect loops on gohugo.io


#1

Hi! We’ve released a new redirects engine about 8 months ago and have tested it pretty thoroughly. In the past days, we’ve migrated all the sites that where still on our legacy redirects engine (gohugo.io is likely one of those). The old redirects engine ignored most broken redirects but the new one is more strict in the interest of better performance and correctness. This is the reason those redirects have only recently caused issues. Let me know if you have any followup questions.

Is the answer I got from Netlify. I think we have fixed them all (I did some grepping), but if not, please shout … Or faster: Just remove the alias in the docs repo and create a PR.


#2

That means that the aliases front-matter cannot be used if deploying using Netlify? I noticed that you created an aliases.txt for hugoDocs. Is there a script for that?

Also, is removing aliases the only way? Wouldn’t disableAliases work? What if one later wants to switch away from Netlify?


#3

It means that aliases that bites yourself in the tail cannot be used.


#4

Just to try to make this straight:

  • In the gohugo.io site we have disabled alias generation (which is client side redirects)
  • Instead we use those alias definitions in front matter to generate one “_redirects” file. This is a Netlify construct that creates proper HTTP 301.
  • Netlify has now improved this “redirect engine”, which makes faulty aliases fail. I.e. aliases that points to themself, which makes a infinite loop.

#5

Thanks, the problem is better understood now.

So ugly URL aliases and language redirection aliases (/en/foo -> /foo) are now not needed.