Hi David & Claus,
note the slash before the dollar sign on those, that means that the
URL needs to end with a slash, so:

$ curl -v https://camel.apache.org/components/latest

gives 404, whereas:

$ curl -v https://camel.apache.org/components/latest/

redirects to https://camel.apache.org/components/next/

The source of confusion might be that:

$ curl -v https://camel.apache.org/components

redirects to https://camel.apache.org/components/ and then to
https://camel.apache.org/components/next/

This I think is due to the `DirectorySlash`[1] being set to `On`, most
likely somewhere in the server configuration; and then hitting the
rule used above. Since the `/component/latest` directory no longer
exists the `DirectorySlash` doesn't take effect (no directory), so the
redirect to `/component/latest/` doesn't happen and the rule to
redirect to `/component/next/` doesn't trigger. We could add something
like:

Redirect 301 /components/latest /components/next/
Redirect 301 /camel-spring-boot/latest /camel-spring-boot/next/
Redirect 301 /camel-karaf/latest /camel-karaf/next/
Redirect 301 /camel-k/latest /camel-k/next/
Redirect 301 /camel-kafka-connector/latest /camel-kafka-connector/next/
Redirect 301 /camel-quarkus/latest /camel-quarkus/next/

To cover that case, though not sure where /.../latest (without the
slash) would be linked from, if someone copy-pasted the link from the
address bar in the browser it should already contain the slash at the
end.

There is no rule to redirect
https://camel.apache.org/components/<something> to
https://camel.apache.org/components/next/<something>, so getting a 404
for https://camel.apache.org/components/activemq-component.html is
expected. To be honest, not sure we need such a rule, and it might be
a bit fiddly to add one given that there are sub-directories within
components, that rule if not written carefully could create an endless
loop.

To me more worrying, and as David also notes, is that the rules to
redirect latest to next don't seem to work, i.e.

$ curl -v https://camel.apache.org/components/latest/activemq-component.html

should lead to a redirect to
https://camel.apache.org/components/next/activemq-component.html

I'll have a bit of a look and try to sort this out.

zoran

[1] http://httpd.apache.org/docs/current/mod/mod_dir.html#directoryslash

On Fri, Oct 29, 2021 at 5:33 AM David Jencks <david.a.jen...@gmail.com> wrote:
>
> Well, that’s not a very useful url… I tried
>
> % curl -k https://camel.apache.org/components/activemq-component.html
> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta 
> name="viewport" content="width=device-width,initial-scale=1"> <title>Page Not 
> Found :: Apache Camel</title> <meta name="generator" content="Antora 
> 3.0.0-alpha…
>
> same for
>
> % curl -k https://camel.apache.org/components/latest/activemq-component.html
>
> I also got the error page for
>
> % curl -k https://camel.apache.org/components/latest
>
> (curl on my mac doesn’t seem to know about any certificates, thus  the -k)
>
> This matches the behavior in my browser when I try to use the redirects on an 
> actual page.
>
> David Jencks
>
> > On Oct 28, 2021, at 12:53 PM, Zoran Regvart <zo...@regvart.com> wrote:
> >
> > Hi David,
> > I've tried the one on 1288 line:
> >
> > $ curl https://camel.apache.org/components/
> > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> > <html><head>
> > <title>301 Moved Permanently</title>
> > </head><body>
> > <h1>Moved Permanently</h1>
> > <p>The document has moved <a
> > href="https://camel.apache.org/components/next/";>here</a>.</p>
> > </body></html>
> >
> > and a couple below it, and it works on my end, a typo at your end?
> >
> > zoran
> >
> > On Wed, Oct 27, 2021 at 11:56 PM David Jencks <david.a.jen...@gmail.com> 
> > wrote:
> >>
> >> It appears the rewrite rules in camel-website static/.htaccess starting at 
> >> line 1288 aren’t working.  Does anyone know now to investigate what’s 
> >> going on?
> >> Did they work before the recent latest >> next change?
> >>
> >> David Jencks
> >
> >
> >
> > --
> > Zoran Regvart
>


-- 
Zoran Regvart

Reply via email to