No, it depends on where you deploy your site.
Here’s an example Netlify redirect file; it redirects http://ox-hugo.scripter.co/test/ to https://ox-hugo-tests.netlify.com/ while retaining the URL prefix (So while the URL shows https://ox-hugo.scripter.co/test/posts/no-toc-in-summary--without-more/
, it’s actually loading https://ox-hugo-tests.netlify.com/posts/no-toc-in-summary--without-more/
).
I mention this example because it might apply to your use case too (show URL with /latest/
in path, but actually load pages from /2.8/
?).
I am not a web developer, so forgive me if I am stating the obvious.
If you are using Netlify, its Redirect & Rewrite rules article would help.
Update: Add info about empty _index.md
file.
I also need an empty _index.md
for the test/
section so that Hugo generates a valid page for that.
content/test/_index.md
+++
title = "Test Site"
+++