# 404 未找到：服务器上找不到请求的 URL。如果手动输入了 URL，请检查拼写并重试。

- **ID:** `python/flask-blueprint-url-prefix-double-slash`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

蓝图以 url_prefix='/api/' 注册，路由为 '/items'，生成 '/api//items'；客户端请求 '/api/items'。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 2.x | active | — | — |
| 3.x | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   app.register_blueprint(bp, url_prefix='/api')  # no trailing slash
   ```
2. **** (85% 成功率)
   ```
   Print app.url_map to verify generated rules: print(app.url_map)
   ```

## 无效尝试

- **** — Does not fix the doubled slash. (75% 失败率)
- **** — Masks the real prefix bug and creates security surface. (70% 失败率)
