Skip to content

Commit 036873b

Browse files
Copilothotlong
andcommitted
Fix homepage 404 by removing Chinese language redirect
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent b6dede4 commit 036873b

2 files changed

Lines changed: 5 additions & 17 deletions

File tree

packages/site/lib/site-config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ const defaultConfig: SiteConfig = {
9191
i18n: {
9292
enabled: true,
9393
defaultLanguage: 'en',
94-
languages: ["en", "cn"
95-
],
94+
languages: ["en"],
9695
},
9796
branding: {
9897
logo: {

packages/site/proxy.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,11 @@ const fumadocsMiddleware = createI18nMiddleware(i18n);
88
export default function proxy(request: NextRequest, event: NextFetchEvent) {
99
const path = request.nextUrl.pathname;
1010

11-
// Handle root path separately with custom language detection
11+
// Handle root path - redirect to English docs
1212
if (path === '/') {
13-
const acceptLanguage = request.headers.get('accept-language') || '';
14-
15-
// Simple language detection: check if zh is in Accept-Language
16-
if (acceptLanguage.toLowerCase().includes('zh')) {
17-
// Redirect to Chinese docs
18-
const url = request.nextUrl.clone();
19-
url.pathname = '/cn/docs';
20-
return NextResponse.redirect(url);
21-
} else {
22-
// Redirect to default language (English)
23-
const url = request.nextUrl.clone();
24-
url.pathname = '/en/docs';
25-
return NextResponse.redirect(url);
26-
}
13+
const url = request.nextUrl.clone();
14+
url.pathname = '/en/docs';
15+
return NextResponse.redirect(url);
2716
}
2817

2918
// For all other paths, pass through to fumadocs middleware

0 commit comments

Comments
 (0)