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 9139ef367c Revert "Fix redirects from empty legacy directories"
9139ef367c is described below
commit 9139ef367c720018c2300b100d454f5801b5d618
Author: Piotr P. Karwasz <[email protected]>
AuthorDate: Fri May 24 20:40:10 2024 +0200
Revert "Fix redirects from empty legacy directories"
This reverts commit e44d39617bf1a4dd148908c1131c2ed4ea396789.
---
.htaccess | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/.htaccess b/.htaccess
index 96f9118a1e..ec2dfaf963 100644
--- a/.htaccess
+++ b/.htaccess
@@ -22,8 +22,9 @@ RewriteBase "/log4j/2.x/"
##
# To simplify the redirection rules, we normalized them:
#
-# 1. If the request URIs points to a directory, we add `index.html` to it
-RewriteRule "^(.*/)$" "$1index.html" [DPI]
+# 1. If the request URIs points to a (non-existent) directory, we add
`index.html` to it
+RewriteCond %{REQUEST_FILENAME} !-d
+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$"