This is an automated email from the ASF dual-hosted git repository.
pkarwasz pushed a commit to branch release/2.22.1
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/release/2.22.1 by this push:
new 497bb54af6 Replace HTML redirect with HTTP redirect
497bb54af6 is described below
commit 497bb54af6fa9948b39fd69653b68f6dfb3b52f2
Author: Piotr P. Karwasz <[email protected]>
AuthorDate: Fri Dec 22 15:13:22 2023 +0100
Replace HTML redirect with HTTP redirect
---
src/site/resources/log4j-api/.htaccess | 3 +++
src/site/resources/log4j-api/apidocs/index.html | 32 ------------------------
src/site/resources/log4j-core/.htaccess | 3 +++
src/site/resources/log4j-core/apidocs/index.html | 32 ------------------------
4 files changed, 6 insertions(+), 64 deletions(-)
diff --git a/src/site/resources/log4j-api/.htaccess
b/src/site/resources/log4j-api/.htaccess
new file mode 100644
index 0000000000..dfb7b4c7b7
--- /dev/null
+++ b/src/site/resources/log4j-api/.htaccess
@@ -0,0 +1,3 @@
+RewriteEngine On
+RewriteCond "%{REQUEST_URI}" "^(/log4j/[^/]+)"
+RewriteRule "^apidocs(.*)$" "%1/javadoc/log4j-api$1" [R=permanent]
diff --git a/src/site/resources/log4j-api/apidocs/index.html
b/src/site/resources/log4j-api/apidocs/index.html
deleted file mode 100644
index 4283511580..0000000000
--- a/src/site/resources/log4j-api/apidocs/index.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE html>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<html lang="en">
-<head>
- <title>Log4j API Javadoc</title>
- <!-- Log4j 2.20.0 moved `/<module>/apidocs` to `/javadoc/<module>`.
- This change broke many users' links to the old URL:
https://github.com/apache/logging-log4j2/issues/1284
- We have this HTML-based redirect here to continue support these old
URLs. -->
- <meta http-equiv="refresh" content="0;
url='../../javadoc/log4j-api/index.html'"/>
-</head>
-<body>
-<p>
- The page you requested has been relocated to <a
href="../../javadoc/log4j-api/index.html">../../javadoc/log4j-api/index.html</a>.
- You are getting redirected...
-</p>
-</body>
-</html>
diff --git a/src/site/resources/log4j-core/.htaccess
b/src/site/resources/log4j-core/.htaccess
new file mode 100644
index 0000000000..cedce8f929
--- /dev/null
+++ b/src/site/resources/log4j-core/.htaccess
@@ -0,0 +1,3 @@
+RewriteEngine On
+RewriteCond "%{REQUEST_URI}" "^(/log4j/[^/]+)"
+RewriteRule "^apidocs(.*)$" "%1/javadoc/log4j-core$1" [R=permanent]
diff --git a/src/site/resources/log4j-core/apidocs/index.html
b/src/site/resources/log4j-core/apidocs/index.html
deleted file mode 100644
index 325ba57775..0000000000
--- a/src/site/resources/log4j-core/apidocs/index.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE html>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<html lang="en">
-<head>
- <title>Log4j Implementation Javadoc</title>
- <!-- Log4j 2.20.0 moved `/<module>/apidocs` to `/javadoc/<module>`.
- This change broke many users' links to the old URL:
https://github.com/apache/logging-log4j2/issues/1284
- We have this HTML-based redirect here to continue support these old
URLs. -->
- <meta http-equiv="refresh" content="0;
url='../../javadoc/log4j-core/index.html'"/>
-</head>
-<body>
-<p>
- The page you requested has been relocated to <a
href="../../javadoc/log4j-core/index.html">../../javadoc/log4j-core/index.html</a>.
- You are getting redirected...
-</p>
-</body>
-</html>