I looked into this a little bit, using the Antora 3 `latest-version-segment` feature:
urls: redirect_facility: httpd latest_version_segment_strategy: redirect:from latest_version_segment: latest This generates the following in the generated .htaccess: Redirect 302 /manual/latest /manual Redirect 302 /components/latest /components/3.12.x Redirect 302 /camel-k/latest /camel-k/1.6.x Redirect 302 /camel-kamelets/latest /camel-kamelets/next Redirect 302 /camel-quarkus/latest /camel-quarkus/2.4.x Redirect 302 /camel-kafka-connector/latest /camel-kafka-connector/0.11.0 Redirect 302 /camel-spring-boot/latest /camel-spring-boot/3.12.x Redirect 302 /camel-karaf/latest /camel-karaf/3.12.x - I think in any case we should use Redirect rather than Rewrite as in fact we want to generate redirects. - I think we should use 302 rather than 301 since these redirects will change as we release newer versions. - I think that a RedirectMatch rule that redirects <project>/<not concrete version or `next`>/ to the same target is likely to work: such a rule can easily be generated from the above. So I’m thinking: - extract the above from the generated .htaccess - transform to the <project> >>> <project>/<latest concrete release> form, and add to generated .htaccess - insert the generated .htaccess in an appropriate place in static .htaccess I don’t have any good ideas yet on how or where to do this. I imagine the gulp file would be a good place but I’m not an expert on having gulp transform individual files. David Jencks > On Oct 29, 2021, at 7:40 AM, Zoran Regvart <zo...@regvart.com> wrote: > > Hi David, > > On Fri, Oct 29, 2021 at 4:24 PM David Jencks <david.a.jen...@gmail.com> wrote: >> >> Well, I agree and am considering how to make that happen. This redirects >> the previous `latest` links to the same pages which are now at `next` so at >> least we don’t have broken links (someone pointed one out on Zulip just now). >> >> Currently the latest released main camel version is 3.12.x. Taking activemq >> as an example, there are 3 pages that I think should end up in the same >> place: >> >> https://camel.apache.org/components/activemq-component.html >> https://camel.apache.org/components/latest/activemq-component.html >> https://camel.apache.org/components/3.12.x/activemq-component.html > > In that case the RewriteRule needs to be changed not to redirect the > first URL to `/components/next/...`. How would we go about redirecting > "" and "latest" to 3.12.x, we'd need to compute what the latest > release is. Which we do in in Hugo bits for the download page > >> Antora can produce a rewrite rule (I think) to deal with one redirection. >> Using this would mean we’d have to incorporate an Antora generated .htaccess >> into a static one, which would be nice for other reasons, namely we can have >> working page aliases. > > Can Antora help with the above ("" and "latest -> 3.12.x)? > >> I don’t think we want to have a manually maintained rewrite rule that >> directs to the concrete version. > > Not at all, this would be error prone and we would forget that it > needs to be done. > >> Which of these should be the URL the other two redirect to? I’d think the >> one with the concrete version 3.12.x. > > 3.12.x makes sense for me, but only if we have a way to auto-maintain > it, otherwise it's just more work to keep track of... > >> Do we actually want all 3 urls to work or can we get by with two? > > Not sure, having all three makes sense to me, the first one ("") bit > less than the others, but if possible I'd still include it... > > (2c) > > zoran > -- > Zoran Regvart