rsnext/docs
Hassan El Mghari ae2d901eed
Improve rewrites documentation (#34725)
This is a PR to update the rewrites documentation. This is after struggling to get rewrites to work with `trailingSlash` for a customer as this wasn't documented. The main culprit was the `:path*` wildcard not catching trailing slashes. The changes made to for this commit were:

- [x] Added example for redirecting to blog and docs
- [x] Expanded on original code example for external URLs
- [x] Added code example for using rewrites with `trailingSlash`

### Context

For a reproduction of the `:path*` wildcard not catching trailing slashes as expected, see below. Click on the "not working" demo link below, navigate to a specific blog post, then reload the page. It will redirect infinitely.

- [Not working demo of main repo with `:path*`](https://redirect-demo-git-not-working-nutlope.vercel.app/blog/)
- [Working demo of main repo with `:path(.+)`](https://redirect-demo.vercel.app/blog/)

If you want to take a look at the code, here are the full repos. They both have `trailingSlash: true`:

- [not working main repo](https://github.com/Nutlope/redirect-demo/tree/not-working) 
- [working main repo](https://github.com/Nutlope/redirect-demo)
- [blog repo](https://github.com/Nutlope/starter-blog-example)
2022-02-24 22:25:56 +00:00
..
advanced-features Fix typo in documentation (#34734) 2022-02-23 18:29:12 +00:00
api-reference Improve rewrites documentation (#34725) 2022-02-24 22:25:56 +00:00
api-routes Fix typo (#34480) 2022-02-17 15:18:59 +00:00
basic-features Remove page-specific font example from docs (#34694) 2022-02-22 23:17:01 +00:00
guides Few touch-ups to the docs on web forms in Next (#34286) 2022-02-14 20:21:27 +00:00
migrating Changed all occurrences of etc to match (#34280) 2022-02-13 00:22:52 +00:00
routing Fixed duplicate data fetching overview page + links (#33774) 2022-01-29 02:52:40 +00:00
authentication.md Alphabetize auth docs providers. (#34281) 2022-02-13 00:51:53 +00:00
deployment.md Update deployment docs to fix oversized image. (#33934) 2022-02-03 02:30:15 +00:00
faq.md fix: change showcase url (#34590) 2022-02-19 22:33:32 +00:00
getting-started.md Replace babel with SWC & minor changes in getting started (#34282) 2022-02-13 03:03:25 +00:00
going-to-production.md Updated going-to-production with loading performance (#33179) 2022-02-04 16:30:55 +00:00
manifest.json docs: React 18, streaming SSR, RSC with new APIs. (#33986) 2022-02-15 22:35:30 -06:00
middleware.md Fix typo (#34480) 2022-02-17 15:18:59 +00:00
testing.md Update testing.md (#34661) 2022-02-22 03:06:03 +00:00
upgrading.md Update upgrading.md (#31173) 2021-11-08 20:53:25 +00:00