Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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)
- Loading branch information