This is an automated email from the ASF dual-hosted git repository.
pkarwasz pushed a commit to branch 2.x-site-stg-out
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/2.x-site-stg-out by this push:
new b0ffa9d483 Fix redirects from empty directories (2)
b0ffa9d483 is described below
commit b0ffa9d48310bfee17e3030a07cad368784f951d
Author: Piotr P. Karwasz <[email protected]>
AuthorDate: Fri May 24 20:51:24 2024 +0200
Fix redirects from empty directories (2)
---
.htaccess | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/.htaccess b/.htaccess
index ec2dfaf963..c0edee979c 100644
--- a/.htaccess
+++ b/.htaccess
@@ -22,13 +22,12 @@ RewriteBase "/log4j/2.x/"
##
# To simplify the redirection rules, we normalized them:
#
-# 1. If the request URIs points to a (non-existent) directory, we add
`index.html` to it
-RewriteCond %{REQUEST_FILENAME} !-d
+# 1. If the request URIs points to a directory, we add `index.html` to it
RewriteRule "^(.*)/$" "$1/index.html" [DPI]
# 2. If the request URI points to a (non-existent) file, we make sure it ends
with `.html`:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 "!\.html$"
-RewriteRule "^(.*)$" "$1.html"
+RewriteRule "^(+*)$" "$1.html"
#
# From this point rules match against the URI to the real file, with
"/log4j/2.x/" stripped.