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

shuai pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/answer-website.git


The following commit(s) were added to refs/heads/main by this push:
     new ed2d12983 feat: add .htaccess for URL rewriting and custom 404 error 
handling (#323)
ed2d12983 is described below

commit ed2d12983614c0da14325aee44e65f916c121587
Author: Luffy <lu...@apache.org>
AuthorDate: Wed Jun 4 09:51:42 2025 +0800

    feat: add .htaccess for URL rewriting and custom 404 error handling (#323)
    
    Close #322
---
 static/.asf.yaml                |  8 ++++----
 static/{.asf.yaml => .htaccess} | 24 ++++++------------------
 2 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/static/.asf.yaml b/static/.asf.yaml
index e2a66517a..b835c4cb4 100644
--- a/static/.asf.yaml
+++ b/static/.asf.yaml
@@ -17,12 +17,12 @@
 
 # NOTE: All configurations could be found here: 
https://cwiki.apache.org/confluence/display/INFRA/Git+-+.asf.yaml+features
 github:
-  description: "Answer official website."
-  homepage: https://answer.apache.org/
+  description: "Apache Answer official website."
+  homepage: https://answer.apache.org
   enabled_merge_buttons:
     squash: true
-    merge: true
-    rebase: false
+    rebase: true
+    merge: false
   protected_branches:
     main: {}
     dist-pages: {}
diff --git a/static/.asf.yaml b/static/.htaccess
similarity index 58%
copy from static/.asf.yaml
copy to static/.htaccess
index e2a66517a..8da9c54e6 100644
--- a/static/.asf.yaml
+++ b/static/.htaccess
@@ -15,23 +15,11 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# NOTE: All configurations could be found here: 
https://cwiki.apache.org/confluence/display/INFRA/Git+-+.asf.yaml+features
-github:
-  description: "Answer official website."
-  homepage: https://answer.apache.org/
-  enabled_merge_buttons:
-    squash: true
-    merge: true
-    rebase: false
-  protected_branches:
-    main: {}
-    dist-pages: {}
+RewriteEngine On
 
-publish:
-  whoami: dist-pages
+RewriteCond %{REQUEST_URI} ^/zh-CN/
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule ^.*$ /zh-CN/404.html [L]
 
-notifications:
-  commits:      commits@answer.apache.org
-  issues:       commits@answer.apache.org
-  pullrequests: commits@answer.apache.org
-  discussions:  commits@answer.apache.org
+ErrorDocument 404 /404.html

Reply via email to