An alias like:
aliases: ["/?page_id=925/"]
makes the build fail on Windows because “?” character is not allowed in filenames.
I tried “cheating” by replacing ?
by its encoded counterpart %3F
, but then it’s not decoded back by the browser because the folder generated by Hugo is using %3F
and not ?
.
I know it’s not a Hugo caveat, but as a workaround I would like to disable aliases while not removing them from content files, so that it doesn’t make the build fail when I work on Windows ; then in production the build is on Linux via CI/CD so the alias should work (well I’m not sure because the character would need to be escaped apparently).
I know it’s very specific, but should we implement a config option or something to disable or work around “non OS friendly” aliases so that Hugo users can still build their project?
Otherwise I guess I’ll have to use server redirects.