Automatic redirection in Antora

I have to reorganize a documentation from a flat-file structure (all adoc files in one directory) to subdirectory structure. But instead of leaving a 404 behind a would like to make an automatic redirection:
./pages/somefile.adoc → ./pages/subdir/somefile.adoc

For wiki pages there is a macro which does a redirection. Can I do something like that in Antorra as well? Something like

<head>
  <meta http-equiv='refresh' content='0; URL=/subdir/newaddress.adoc/'>
</head>

<body>
       <p>Page moved to <a href="/subdir/newaddress.adoc">tsubdir/newaddress.adoc</a>.</p>
</body>

Yes, you can!
https://docs.antora.org/antora/latest/page/page-aliases/

The only thing to remember is the alias definition goes on the new page, not the old one.
Using your provided example:
pages/somefile.adoc is deleted
and in pages/subdir/somefile.adoc, you add the :page-aliases: directive.
Something like:

:page-aliases: pages/somefile.adoc
3 Likes

Thanks! That is very easy and very smart.

I frequently look this one up too. It could be handy to call this out in the AsciiDoc for Fedora contributor guide section in the Docs Team docs:

https://docs.fedoraproject.org/en-US/fedora-docs/contributing-docs/asciidoc-intro/