Hi, Victor. This is happening because the links to the resources are relative links. For example:
<link rel="stylesheet" href="./main.css">
For the first URL (https://404-test.netlify.com/test) the path is /test and this is in / so the relative path is /main.css. That is a valid path to an existing asset.
For the second URL (https://404-test.netlify.com/test/) the path is /test/. Because this is in /test/ the same relative URL now points to /test/main.css. This is not a valid path to an existing asset so a 404 occurs for that URL (which is https://404-test.netlify.com/test/main.css).
The solution for this is to make those paths absolute, instead of relative. For example:
<link rel="stylesheet" href="/main.css">
This change above (removing the “.” before “/main.css”) would cause both URLs to use a path of /main.css for this asset.
Regarding what to change in your Hugo configuration to make that happen, that a Hugo specific question and that I don’t know the answer to.
I suspect the solution (for that CCS file) is to change this here:
Setting relativeURLs to false in the site configuration (while keeping .RelPermalink) solved the problem, but now I’ll have to check the URLs in content files.