This is an automated email from the ASF dual-hosted git repository.

zregvart pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-website.git


The following commit(s) were added to refs/heads/main by this push:
     new 93b65c8  fix: latest -> next redirects for camel-k
93b65c8 is described below

commit 93b65c838b74da17ab6b7e3983ec6f0d998673bc
Author: Zoran Regvart <[email protected]>
AuthorDate: Fri Oct 29 17:36:34 2021 +0200

    fix: latest -> next redirects for camel-k
---
 static/.htaccess  | 4 ++--
 tests/redirect.sh | 9 +++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/static/.htaccess b/static/.htaccess
index 602caad..c128013 100644
--- a/static/.htaccess
+++ b/static/.htaccess
@@ -1302,8 +1302,8 @@ RewriteCond %{REQUEST_FILENAME} !-f
 #  * we need to be careful with Antora componets with the same prefixes
 #    e.g. camel-k, camel-karaf and camel-kafka-connector, so we don't match
 #    partialy and capture the rest of the Antora component name in subsequent
-#    groups
-RewriteRule 
^(components|camel-spring-boot|camel-k(?:araf|afka-connector)|camel-quarkus)(?|(/latest)|(?!/next))/?(.*)$
 /$1/next/$3 [R=permanent,L]
+#    groups, that's why we have the negative lookahead in the camel-k option
+RewriteRule 
^(components|camel-spring-boot|(?:camel-k(?!afka-connector|araf)|camel-kafka-connector|camel-karaf)|camel-quarkus)(?|(/latest)|(?!/next))/?(.*)$
 /$1/next/$3 [R=permanent,L]
 
 # manual is now unversioned
 Redirect 301 /manual/latest/ /manual/
diff --git a/tests/redirect.sh b/tests/redirect.sh
index 8b959de..b9398cb 100755
--- a/tests/redirect.sh
+++ b/tests/redirect.sh
@@ -34,6 +34,15 @@ test $BASE_URL/camel-spring-boot/latest/ 301 
$BASE_URL/camel-spring-boot/next/
 test $BASE_URL/camel-spring-boot/latest/list.html 301 
$BASE_URL/camel-spring-boot/next/list.html
 test $BASE_URL/camel-spring-boot/next/list.html 200
 
+test $BASE_URL/camel-k 301 $BASE_URL/camel-k/next/
+test $BASE_URL/camel-k/ 301 $BASE_URL/camel-k/next/
+test $BASE_URL/camel-k/next 301 $BASE_URL/camel-k/next/
+test $BASE_URL/camel-k/next/ 200
+test $BASE_URL/camel-k/latest 301 $BASE_URL/camel-k/next/
+test $BASE_URL/camel-k/latest/ 301 $BASE_URL/camel-k/next/
+test $BASE_URL/camel-k/latest/traits/master.html 301 
$BASE_URL/camel-k/next/traits/master.html
+test $BASE_URL/camel-k/next/traits/master.html 200
+
 test $BASE_URL/camel-karaf 301 $BASE_URL/camel-karaf/next/
 test $BASE_URL/camel-karaf/ 301 $BASE_URL/camel-karaf/next/
 test $BASE_URL/camel-karaf/next 301 $BASE_URL/camel-karaf/next/

Reply via email to