Skip to content

Commit ed2d129

Browse files
authored
feat: add .htaccess for URL rewriting and custom 404 error handling (#323)
Close #322
1 parent adcc3e9 commit ed2d129

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

static/.asf.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717

1818
# NOTE: All configurations could be found here: https://cwiki.apache.org/confluence/display/INFRA/Git+-+.asf.yaml+features
1919
github:
20-
description: "Answer official website."
21-
homepage: https://answer.apache.org/
20+
description: "Apache Answer official website."
21+
homepage: https://answer.apache.org
2222
enabled_merge_buttons:
2323
squash: true
24-
merge: true
25-
rebase: false
24+
rebase: true
25+
merge: false
2626
protected_branches:
2727
main: {}
2828
dist-pages: {}

static/.htaccess

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
RewriteEngine On
19+
20+
RewriteCond %{REQUEST_URI} ^/zh-CN/
21+
RewriteCond %{REQUEST_FILENAME} !-f
22+
RewriteCond %{REQUEST_FILENAME} !-d
23+
RewriteRule ^.*$ /zh-CN/404.html [L]
24+
25+
ErrorDocument 404 /404.html

0 commit comments

Comments
 (0)