Skip to content

Commit c41494b

Browse files
committed
remove redirect
1 parent 7ac5f13 commit c41494b

1 file changed

Lines changed: 7 additions & 23 deletions

File tree

packages/next/src/lib/load-custom-routes.ts

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -674,29 +674,13 @@ export default async function loadCustomRoutes(
674674

675675
if (!config.skipTrailingSlashRedirect) {
676676
if (config.trailingSlash) {
677-
redirects.unshift(
678-
{
679-
source: '/:file((?!\\.well-known(?:/.*)?)(?:[^/]+/)*[^/]+\\.\\w+)/',
680-
destination: '/:file',
681-
permanent: true,
682-
locale: config.i18n ? false : undefined,
683-
internal: true,
684-
// don't run this redirect for _next/data requests
685-
missing: [
686-
{
687-
type: 'header',
688-
key: 'x-nextjs-data',
689-
},
690-
],
691-
} as Redirect,
692-
{
693-
source: '/:notfile((?!\\.well-known(?:/.*)?)(?:[^/]+/)*[^/\\.]+)',
694-
destination: '/:notfile/',
695-
permanent: true,
696-
locale: config.i18n ? false : undefined,
697-
internal: true,
698-
} as Redirect
699-
)
677+
redirects.unshift({
678+
source: '/:notfile((?!\\.well-known(?:/.*)?)(?:[^/]+/)*[^/\\.]+)',
679+
destination: '/:notfile/',
680+
permanent: true,
681+
locale: config.i18n ? false : undefined,
682+
internal: true,
683+
} as Redirect)
700684
if (config.basePath) {
701685
redirects.unshift({
702686
source: config.basePath,

0 commit comments

Comments
 (0)