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 7b4130df92 IGNITE-27761 Fix htaccess rules (#316)
7b4130df92 is described below

commit 7b4130df9292d8694f1e47445ead8b70becafb6f
Author: Alexey Alexandrov <[email protected]>
AuthorDate: Thu Feb 5 18:39:13 2026 +0200

    IGNITE-27761 Fix htaccess rules (#316)
---
 .htaccess | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/.htaccess b/.htaccess
index 3bc9375611..7f623b9af4 100644
--- a/.htaccess
+++ b/.htaccess
@@ -157,11 +157,6 @@ 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]
 
@@ -207,15 +202,24 @@ RewriteRule ^docs/ignite3/latest$ docs/ignite3/latest/ 
[R=301,L]
 
 # =============================================================================
 # Ignite 3: prefer .html pages over same-name directories (NO trailing slash)
+# Works with DirectorySlash ON (default).
 # =============================================================================
 
-# If user hits .../page/ and page.html exists -> redirect to .../page (no 
slash)
-RewriteCond %{REQUEST_URI} ^/docs/ignite3/(.+)/$
+# Canonical: if browser requested .../page/ and page.html exists -> 301 to 
.../page
+RewriteCond %{THE_REQUEST} \s/+docs/ignite3/(.+)/[\s?]
 RewriteCond %{DOCUMENT_ROOT}/docs/ignite3/%1.html -f
 RewriteRule ^docs/ignite3/(.+)/$ /docs/ignite3/$1 [R=301,L]
 
-# If user hits .../page (no ext) and page.html exists -> serve page.html
+# Serve page.html when request is .../page/ and page.html exists (prevents 
directory handling)
+RewriteCond %{REQUEST_URI} ^/docs/ignite3/
+RewriteCond %{REQUEST_URI} !\.html$
+RewriteCond %{REQUEST_URI} ^(.+)/$
+RewriteCond %{DOCUMENT_ROOT}%1.html -f
+RewriteRule ^docs/ignite3/(.+)/$ docs/ignite3/$1.html [L]
+
+# Serve page.html when request is .../page (no ext) and page.html exists
 RewriteCond %{REQUEST_URI} ^/docs/ignite3/
+RewriteCond %{REQUEST_URI} !\.html$
 RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI}.html -f
 RewriteRule ^docs/ignite3/(.+)$ docs/ignite3/$1.html [L]
 
@@ -233,14 +237,12 @@ RewriteRule ^(.+)$ /$1/ [R=301,L]
 # =============================================================================
 
 # Serve index.html for directory requests under /docs/ignite3/
-# This handles Docusaurus clean URLs (e.g., 
/docs/ignite3/3.1.0/getting-started/)
 RewriteCond %{REQUEST_URI} ^/docs/ignite3/
 RewriteCond %{REQUEST_FILENAME} -d
 RewriteCond %{REQUEST_FILENAME}/index.html -f
 RewriteRule ^(.*)$ $1/index.html [L]
 
 # For non-directory paths under /docs/ignite3/, try adding /index.html
-# This handles paths like /docs/ignite3/3.1.0/getting-started (no trailing 
slash)
 RewriteCond %{REQUEST_URI} ^/docs/ignite3/
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d

Reply via email to