From 4443d6f3d36b107e833376c2720c1e206eee720d Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Tue, 11 May 2021 12:29:53 -0500 Subject: [PATCH] Update has redirect examples (#25003) This fixes an infinite redirect in the `has` redirect examples by ensuring not to match the redirect destination itself ## Documentation / Examples - [x] Make sure the linting passes --- docs/api-reference/next.config.js/redirects.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/api-reference/next.config.js/redirects.md b/docs/api-reference/next.config.js/redirects.md index 8471627ff580f..7dd369881fee5 100644 --- a/docs/api-reference/next.config.js/redirects.md +++ b/docs/api-reference/next.config.js/redirects.md @@ -140,7 +140,7 @@ module.exports = { // if the header `x-redirect-me` is present, // this redirect will be applied { - source: '/:path*', + source: '/:path((?!another-page$).*)', has: [ { type: 'header', @@ -170,12 +170,12 @@ module.exports = { }, ], permanent: false, - destination: '/:path*/:page', + destination: '/another/:path*', }, // if the header `x-authorized` is present and // contains a matching value, this redirect will be applied { - source: '/:path*', + source: '/', has: [ { type: 'header', @@ -189,7 +189,7 @@ module.exports = { // if the host is `example.com`, // this redirect will be applied { - source: '/:path*', + source: '/:path((?!another-page$).*)',, has: [ { type: 'host',