Conversation
**1. 产物目录结构 - 新增 `404.html`** 在产物目录结构中添加了 `404.html` 文件,并说明其用途。 **2. 新增 troubleshooting 章节「刷新页面时出现 404」** - **现象**:站点内导航正常,刷新后 404 - **原因**:SPA 部署问题,客户端路由在刷新时服务器找不到对应文件 - **解决方案**:配置服务器重定向到 `404.html`,并提供了以下托管服务的配置示例: - Nginx - Vercel - Netlify - GitHub Pages - Apache 中英文文档均已同步更新。
1. 删除了 `以下是常见托管服务的配置方法:` / `Here are configuration methods for common hosting services:` 2. 删除了关于 SPA 模式的 tip 提示(因为 Rspress 本质上是 MPA) 3. 简化了原因说明,移除了关于 SPA 的描述
1. 删除了所有托管服务配置示例(Nginx、Vercel、Netlify、GitHub Pages、Apache) 2. 修改了解决方案描述:说明大部分静态托管服务默认会使用 `404.html` 处理未匹配路由,如果服务器没有自动处理才需要手动配置
✅ Deploy Preview for rspress-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR enhances the SSG documentation by addressing a common SPA deployment issue where pages work correctly when navigating through links but show 404 errors upon refresh or direct URL access.
Key changes:
- Documents the
404.htmlfile in the build output structure - Adds a troubleshooting section explaining the 404 refresh issue and its solution
- Provides a
_redirectsfile configuration example for manual setup
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| website/docs/zh/guide/basic/ssg.mdx | Adds Chinese documentation for 404.html handling and SPA deployment troubleshooting |
| website/docs/en/guide/basic/ssg.mdx | Adds English documentation for 404.html handling and SPA deployment troubleshooting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff AnalysisFound 3 projects in monorepo, 3 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 nodePath:
📦 Download Diff Report: node Bundle Diff 📁 node_mdPath:
📦 Download Diff Report: node_md Bundle Diff 📁 webPath:
📦 Download Diff Report: web Bundle Diff Generated by Rsdoctor GitHub Action |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
Related Issue
Checklist
AI Summary
Changes Made
This PR updates the SSG documentation (both Chinese and English) with the following improvements:
Added
404.htmlto output directory structure404.htmlfile is now documented as part of the build outputAdded troubleshooting section: "Page shows 404 after refresh"
404.htmlby default to handle unmatched routes. For servers that don't handle this automatically, manual configuration is needed_redirectsfile example for hosting services that support itWhy These Changes Were Made
Users deploying Rspress sites to static hosting services may encounter 404 errors when refreshing pages or directly accessing URLs. This is a common deployment issue that needed documentation. The
404.htmlfile generated by Rspress contains the complete application code and can correctly handle client-side routing.This PR was written using Vibe Kanban