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

pkarwasz pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


The following commit(s) were added to refs/heads/2.x by this push:
     new c1e98a2559 Enhance `mod_rewrite` rules
c1e98a2559 is described below

commit c1e98a25596307d5d18e470e48080cc2dd1b631c
Author: Piotr P. Karwasz <[email protected]>
AuthorDate: Fri May 24 12:31:03 2024 +0200

    Enhance `mod_rewrite` rules
---
 src/site/resources/.htaccess | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/site/resources/.htaccess b/src/site/resources/.htaccess
index ee5a68abe5..9072d12ac5 100644
--- a/src/site/resources/.htaccess
+++ b/src/site/resources/.htaccess
@@ -17,8 +17,18 @@
 # under the License.
 #
 RewriteEngine On
-RewriteRule "^(/log4j/[23].x)/log4j-(core|api)/apidocs(.*)" "$1/javadoc/$2$3" 
[R=permanent]
-RewriteRule "^(/log4j/[23].x)/manual/api-separation.html" "$1/manual/api.html" 
[R=permanent]
-RewriteRule "^(/log4j/[23].x)/manual/scala-api.html" "/log4j/scala" 
[R=permanent]
-RewriteRule "^(/log4j/[23].x)/manual/usage.html" "$1/manual/api.html" 
[R=permanent]
-RewriteRule "^(/log4j/[23].x)/release-notes/index.html" 
"$1/release-notes.html" [R=permanent]
+
+RewriteCond "%{REQUEST_URI}" "^(/log4j/[23]\.x)/"
+RewriteRule "^log4j-(core|api)/apidocs(.*)$" "%1/javadoc/log4j-$1$2" 
[R=permanent]
+
+RewriteCond "%{REQUEST_URI}" "^(/log4j/[23]\.x)/"
+RewriteRule "^manual/api-separation(\.html)?$" "%1/manual/api.html" 
[R=permanent]
+
+RewriteCond "%{REQUEST_URI}" "^(/log4j/[23]\.x)/"
+RewriteRule "^manual/scala-api(\.html)?$" "/log4j/scala/index.html" 
[R=permanent]
+
+RewriteCond "%{REQUEST_URI}" "^(/log4j/[23]\.x)/"
+RewriteRule "^manual/usage(\.html)?$" "%1/manual/api.html" [R=permanent]
+
+RewriteCond "%{REQUEST_URI}" "^(/log4j/[23]\.x)/"
+RewriteRule "^release-notes/(index(\.html)?)?$" "%1/release-notes.html" 
[R=permanent]

Reply via email to