# defaultIndex 已移除

> Source: https://strapi.nodejs.cn/cms/migration/v4-to-v5/breaking-changes/default-index-removed

🌐 `defaultIndex` is removed from the `public` middleware configuration

在 Strapi 5 中，`public` 中间件的 `defaultIndex` 选项已被移除，根 `/` URL 会在连接时自动重定向到管理员面板登录页或首页。

🌐 In Strapi 5, the `defaultIndex` option is removed from the `public` middleware, and the root `/` URL automatically redirects to the admin panel login or homepage if connected.

在 Strapi 5 中，‘defaultIndex’ 选项不再存在，根目录 `/` URL 会自动重定向到管理面板登录页，或者如果已登录则重定向到主页。

🌐 In Strapi 5, the 'defaultIndex' option does not exist anymore and the root `/` URL automatically redirects to the admin panel login or homepage if already connected.

此页面是[重大更改数据库](/cms/migration/v4-to-v5/breaking-changes)的一部分，提供关于重大更改的信息以及从 Strapi v4 迁移到 Strapi 5 的附加说明。

🌐 This page is part of the [breaking changes database](/cms/migration/v4-to-v5/breaking-changes) and provides information about the breaking change and additional instructions to migrate from Strapi v4 to Strapi 5.

- Is this breaking change affecting plugins? No
- Is this breaking change automatically handled by a codemod? No

## 重大变更描述 {#breaking-change-description}

🌐 Breaking change description

**在 Strapi v4 中**

在 `public` 中间件中有一个 `defaultIndex` 选项，可以在管理面板的根 `/` URL 上添加自定义页面。

🌐 There is a `defaultIndex` option in the `public` middleware to add a custom page on the root `/`   URL of the admin panel.

**在 Strapi 5 中**

`defaultIndex` 选项不再存在，根目录 `/` URL 会自动重定向到管理员面板登录页，或者如果已连接则重定向到主页。

🌐 The `defaultIndex` option does not exist anymore and the root `/` URL automatically redirects to the admin panel login or homepage if already connected.

## 迁移 {#migration}

🌐 Migration

无需手动迁移，但请注意根 `/` URL 的新行为。

🌐 No manual migration is required, but please be aware of the new behavior for the root `/` URL.
