Skip to content

Commit

Permalink
Update has redirect examples (#25003)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ijjk committed May 11, 2021
1 parent 614f105 commit 4443d6f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/api-reference/next.config.js/redirects.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand Down

0 comments on commit 4443d6f

Please sign in to comment.