﻿---
title: "Troubleshooting EdgeOne Pages 404s on Chinese Paths and Migrating Around Them"
tags:
  - Blog
excerpt: A practical log of diagnosing EdgeOne Pages 404s on Chinese paths, migrating URLs, adding redirects, and preserving wiki links and comments.
date: 2026-04-16
updated: 2026-07-08 08:34:26
lang: en
i18n:
  cn: /fix_edgeone_404_issue
  translation: 2
---

<script type="module" src="/js/components/tab.js"></script>

Last night I was in full guabi[^1] mode in the dorm. There are too many things to complain about in this dorm's hardware setup, so I will skip that for now.

I opened the Blog in Chrome and was reminiscing about *Shadong Wangshi*[^2]. Then I found that several older posts went straight to [404](https://vluv.space/404.html).

After some troubleshooting, the pattern became clear: every filename whose path contained Chinese characters returned 404, while pure English paths worked normally.

As a control group, the same pages were accessible on Cloudflare Pages. This was probably not my problem.

So I reported it in the WeChat group, and exactly 0 people responded.

Submitting a support ticket to the official customer service channel was the right move. After talking with technical support, I confirmed that this was a backend bug in EdgeOne and was expected to be fixed in the next version. The detailed release progress would be announced in the WeChat group.

Because the release cycle was uncertain, I did not plan to sit there and wait. I decided to make a temporary workaround first. This post records that migration and repair process.

## Problem Background

My Blog build output is very simple:

<script type="module" src="/js/components/tree.js"></script>
<x-tree root="Build Output">

- 琅琊台
  - index.html
- index.html
- sitemap.xml
- rss.xml
- robots.txt

</x-tree>

Take the [[langya_terrace|Langya Terrace]] post as an example. Its corresponding access path is `https://vluv.space/琅琊台` or `https://vluv.space/琅琊台/index.html`.

### A Interlude 🎞️

Earlier, after one EdgeOne update, every post returned 404 because EdgeOne no longer supported omitting `index.html`.

At that time I wrote an `edgeone.json` workaround, but the official hotfix arrived quickly. I thought everything was fine and deleted the config file.

I did not expect Chinese paths to break again this time, hh.

## Migration Solution

The core migration logic has 3 steps:

1. **Rename**: translate every filename containing non-ASCII characters, such as Chinese, into pure English.
2. **Configure redirects**: configure 301 permanent redirects in `edgeone.json` so old links do not break.
3. **Update Wiki Links**: Obsidian users may use backlinks. After renaming files, the old wiki links stop working too, so they also need to be handled.

Doing this manually is tedious, but AI makes it efficient.

### A Pitfall 🕳

EdgeOne Pages only supports ASCII characters in `redirects.source`, which means Chinese paths must be **URL encoded (Percent Encoding)** first. Otherwise, deployment validation fails:

```log
17:22:23.099
> Start validating the configuration file:
17:22:23.105
error in root.redirects.[0].source: char match error
17:22:23.105
error in root.redirects.[1].source: char match error
17:22:23.106
error in root.redirects.[2].source: char match error
17:22:23.106
error in root.redirects.[3].source: char match error
```

### Prompts

Current LLMs are already good enough. Keeping the prompts here is probably more useful than leaving behind an outdated script.

<x-tabs>

<x-tab title="Fix 404" active>

````md
**任务描述**
基于 EdgeOne Pages 的 edgeone.json 规范（redirects.source 仅支持 ASCII），完成以下任务：

**子任务一：生成路径映射文件**
将所有包含非 ASCII 字符的旧文件名翻译为英文，生成 JSON 映射：
{ "旧文件名": "new-english-path" }

**子任务二：生成 edgeone.json**
基于映射文件，输出符合格式的 edgeone.json：

codeJSON

```
{
  "redirects": [
    {
      "source": "/%E4%B8%AD%E6%96%87",
      "destination": "/new-english-path/",
      "statusCode": 301
    }
  ]
}
```

注：source 必须经过 URL 编码。
````

</x-tab>

<x-tab title="Fix Wiki Link">

Have Coding Agents read the previous JSON file, then use a `{sh} rg` regular expression to match `[[old_file_name` and replace it.

```md
@filename_translation_map.json 查找 @blog/ 目录下有无[[old_file_name存在，如果有，替换成 [[new_file_name
```

For manual searching, use the `{sh} rg -o '\[\[[\u4e00-\u9fa5]'` command.

</x-tab>

</x-tabs>

## Why Bother?

Why go through all this trouble? Mainly because of these factors:

1. **User experience**: prevent indexed links from breaking, so users clicking in from search results will not see a 404.
2. **SEO**: if a large number of old links return 404 directly, search engines will gradually deindex the site. ~~Abin's SEO record is not exactly great.~~

It cost me some time that could have gone into pretending to write my thesis, but it also turned into another Blog post. I have discovered the conservation law of filler posts 🤓

Speaking of the thesis, I want to complain about Microsoft Word again, but I will hold that too, otherwise this post may get too long.

## Postscript

### 2026.4.17: There Is a Second Stage? 🤯

I forgot that Twikoo comments also needed to be migrated. Steps:

1. Visit MongoDB Atlas.
2. Click Data Explorer.
3. After selecting the cluster that stores Twikoo data, click Connect.
4. Select the Twikoo comment table.
5. Execute queries for `{url: { $regex: /[^\x00-\x7F]/ }}` and `{url:{$regex:'%'}}`; the former finds URLs containing non-ASCII characters, while the latter filters Chinese URLs that have already been encoded.
6. Update the `url` and `href` fields in the documents.

🥲 Who would have thought I still had to play with regex in MongoDB? This migration really had all four words of "complexity, repetition, fatigue, and difficulty," although future migrations at work will likely be far more troublesome than this.

If I still had AI quota, I could integrate the MongoDB MCP, enter a prompt, and let the LLM handle this repetitive work. I did a previous Twikoo migration that way, but after my internship ended, the free AI was gone too.

As for visit counts... I am too lazy to migrate them. Let them become numeric ghosts 🪦. I still have a thesis to pad out.

[^1]: "Guabi" mainly refers to a "jobless, low-cost, idle, free" way of living. It originally came from the Shenzhen "[Sanhe Dashen](https://www.google.com/search?q=%E4%B8%89%E5%92%8C%E5%A4%A7%E7%A5%9E&mstk=AUtExfCn1xGzMxOSpo1J7HTrOdmB6YCXXIR4EYw-MX3m4xQiUQ2LAE1TSBG262l4o-_MyBvpJvxcQruFofXQQ5aCKHodyfb8sjt9lWyUw6lRoTbh2LhdvyotYaA_3t6PeW4jhjipR7IFxihZ6HNQMf0gdPsUdnwl06WyLgstrtcuk9pxIfM&csui=3&ved=2ahUKEwjX6P2mjPKTAxXqOTQIHf_hB6MQgK4QegQIARAB)" subculture, meaning young people who live on temporary jobs, stop working once they earn the bare minimum for living expenses, and take life one day at a time. The term later extended into a self-deprecating description of passivity, laziness, or being stuck in a dilemma.
[^2]: The meme comes from *Dongbei Wangshi*. It is generally understood, in the broad sense, to cover all short videos by internet streamers from [Northeast China](https://zh.moegirl.org.cn/%E4%B8%AD%E5%9B%BD%E4%B8%9C%E5%8C%97%E5%9C%B0%E5%8C%BA "中国东北地区") and some streamers from other regions around 2016. These videos became widely circulated because of their distinct regional flavor. In the narrow sense, it refers specifically to a short-video series filmed by Hu Ge, Dao Ge, Shamate Tuanzhang, and others during the same period. ~~Douban rating: 9.7.~~ [东百往事 - 萌娘百科 万物皆可萌的百科全书](https://zh.moegirl.org.cn/%E4%B8%9C%E7%99%BE%E5%BE%80%E4%BA%8B)
