Skip to content

docs(deployment): add localized 404 pages guidance for self-hosting#12117

Open
MasterIfeanyi wants to merge 2 commits into
facebook:mainfrom
MasterIfeanyi:docs/localized-404-pages
Open

docs(deployment): add localized 404 pages guidance for self-hosting#12117
MasterIfeanyi wants to merge 2 commits into
facebook:mainfrom
MasterIfeanyi:docs/localized-404-pages

Conversation

@MasterIfeanyi

@MasterIfeanyi MasterIfeanyi commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

This adds documentation for serving localized 404 pages, as discussed in issue #10473. Users with multi-language sites often don't realize their server needs special configuration to serve locale-specific 404 pages like /fr/404.html.

Test Plan

Ran the Docusaurus website locally with pnpm start and verified the new section appears correctly under "Self-Hosting" at http://localhost:3000/docs/deployment#localized-404-pages

Test links

Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/

Related issues/PRs

Closes #10473

@meta-cla meta-cla Bot added the CLA Signed Signed Facebook CLA label Jun 6, 2026

@slorber slorber left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most Docusaurus sites are not localized, and this is not really related to self-hosting but applies for CDNs like Vercel/Netlify as well.

For that reason I think it's preferable to move it to a i18n page instead.

For example: https://docusaurus.io/docs/next/i18n/tutorial

I would append a ## Translate your 404 page heading/section

Comment thread website/docs/deployment.mdx Outdated

To serve the correct localized 404 page, you need to configure your server to redirect missing pages to the appropriate locale-specific 404 file. For example:

- If a visitor requests `/fr/nonexistent-page`, the server should serve `/fr/404.html` instead of `/404.html`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- If a visitor requests `/fr/nonexistent-page`, the server should serve `/fr/404.html` instead of `/404.html`.
- `/nonexistent-page` should serve `/404.html`
- `/fr/nonexistent-page` should serve `/fr/404.html`
- `/it/nonexistent-page` should serve `/it/404.html`

Little suggestion to clarify things and avoid a bulletlist with a single item

@slorber slorber marked this pull request as draft June 12, 2026 14:27
@MasterIfeanyi MasterIfeanyi marked this pull request as ready for review June 13, 2026 09:38
@netlify

netlify Bot commented Jun 13, 2026

Copy link
Copy Markdown

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 1a2eee0
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/6a2d24fd50614c00087bf77e
😎 Deploy Preview https://deploy-preview-12117--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How can docusaurus' 404 page be adapted to other language pages?

2 participants