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

ptupitsyn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 24fda020ee IGNITE-27758 Fix redirect loop in Ignite3 docs (#315)
24fda020ee is described below

commit 24fda020ee773ab432836fb349cf2978bd9e9610
Author: Alexey Alexandrov <[email protected]>
AuthorDate: Thu Feb 5 17:34:04 2026 +0200

    IGNITE-27758 Fix redirect loop in Ignite3 docs (#315)
---
 .htaccess | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/.htaccess b/.htaccess
index 0c1dae0036..3bc9375611 100644
--- a/.htaccess
+++ b/.htaccess
@@ -157,6 +157,11 @@ RewriteBase /
 # Prevent directory listings (recommended)
 Options -Indexes
 
+# IMPORTANT: avoid DirectorySlash redirect loops with "page/" + "page.html"
+<IfModule mod_dir.c>
+  DirectorySlash Off
+</IfModule>
+
 RewriteCond %{HTTP_HOST} ^(www\.)?ignite.incubator.apache.org$
 RewriteRule ^/?(.*)$ https://ignite.apache.org/$1 [L,R=301]
 
@@ -179,8 +184,11 @@ RewriteRule ^releases/(1[^/]*)(/.*)?$ releases/ignite/$1$2 
[R=301,L]
 # Redirect all release URLs starting with 2.*, 3.*, 4.* ... into "igniteN" 
namespace.
 RewriteRule ^releases/([2-9][^/]*)(/.*)?$ releases/ignite$1/$1$2 [R=301,L]
 
-# docs entry point
-RewriteRule ^docs/?$ docs/index.html [L]
+# ---------------------------------------------------------------------------
+# /docs entry point: canonicalize /docs -> /docs/ and serve /docs/index.html
+# ---------------------------------------------------------------------------
+RewriteRule ^docs$ /docs/ [R=301,L]
+RewriteRule ^docs/$ docs/index.html [L]
 
 # special handling for /docs/latest
 RewriteRule ^docs/latest/?$ docs/ignite2/latest/ [R=301,L]
@@ -208,9 +216,17 @@ RewriteRule ^docs/ignite3/(.+)/$ /docs/ignite3/$1 [R=301,L]
 
 # If user hits .../page (no ext) and page.html exists -> serve page.html
 RewriteCond %{REQUEST_URI} ^/docs/ignite3/
-RewriteCond %{REQUEST_FILENAME}.html -f
+RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI}.html -f
 RewriteRule ^docs/ignite3/(.+)$ docs/ignite3/$1.html [L]
 
+# If it's a real directory with index.html (Docusaurus) AND no same-name .html 
-> enforce trailing slash
+RewriteCond %{REQUEST_URI} ^/docs/ignite3/
+RewriteCond %{REQUEST_URI} !/$
+RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
+RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI}/index.html -f
+RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI}.html !-f
+RewriteRule ^(.+)$ /$1/ [R=301,L]
+
 # =============================================================================
 # Docusaurus clean URL handling for Ignite 3 (/docs/ignite3/)
 # Docusaurus generates static HTML in directories with index.html files

Reply via email to