Skip to content

Commit

Permalink
Merge branch 'canary' of https://github.com/vercel/next.js into remov…
Browse files Browse the repository at this point in the history
…e-mentions-of-the-next-js-site-repo-ch15889
  • Loading branch information
lfades committed Nov 25, 2020
2 parents cfcfd89 + 0ed8152 commit bc7bb51
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/api-reference/next.config.js/redirects.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ module.exports = {

### Regex Path Matching

To match a regex path you can wrap the regex in parenthesis after a parameter, for example `/blog/:slug(\\d{1,})` will match `/blog/123` but not `/blog/abc`:
To match a regex path you can wrap the regex in parenthesis after a parameter, for example `/post/:slug(\\d{1,})` will match `/post/123` but not `/post/abc`:

```js
module.exports = {
async redirects() {
return [
{
source: '/old-blog/:post(\\d{1,})',
destination: '/blog/:post', // Matched parameters can be used in the destination
source: '/post/:slug(\\d{1,})',
destination: '/news/:slug', // Matched parameters can be used in the destination
permanent: false,
},
]
Expand Down

0 comments on commit bc7bb51

Please sign in to comment.