Skip to content

docs: fix link to redirects & rewrites, minor edits #783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 9, 2021
Merged

Conversation

rstavchansky
Copy link

Summary

Fixes broken link from README to redirects & rewrites docs content in this repo.

Test plan

  1. Check out the diff, the README on this branch, and the Redirects & rewrites page on this branch for edits in context.
    ...

Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal (small picture)

Late breaking review of #767


@rstavchansky rstavchansky added the type: chore work needed to keep the product and development running smoothly label Nov 8, 2021
@rstavchansky rstavchansky requested a review from ascorbic November 8, 2021 22:41
@rstavchansky rstavchansky self-assigned this Nov 8, 2021
@@ -2,7 +2,7 @@
Version 4 of the Essential Next.js build plugin adds support for native Next.js [rewrites](https://nextjs.org/docs/api-reference/next.config.js/rewrites) and [redirects](https://nextjs.org/docs/api-reference/next.config.js/redirects). These are defined in your `next.config.js` file and include support for some features that are not included in Netlify redirects and rewrites.

## Using Netlify redirects and rewrites on a Next.js site
Every site on Netlify supports [redirects and rewrites](https://docs.netlify.com/routing/redirects/), which are defined in a `_redirects` file or `netlify.toml`, and sites that use this plugin are no exceptions. However there are some caveats to bear in mind when using them. The plugin generates several rewrites of its own, which are used to map paths from the site to different Netlify functions which handle SSR, preview mode and images, as well as assets in `/_next/static`. Any Netlify redirects or rewrites that you create [take precedence over these rewrites](#Redirect-and-rewrite-precedence), so you should avoid adding a root level rewrite, because that would override the rewrites required by the plugin.
Every site on Netlify supports [redirects and rewrites](https://docs.netlify.com/routing/redirects/), which are defined in a `_redirects` file or `netlify.toml`, and sites that use this plugin are no exceptions. However there are some caveats to bear in mind when using them. The plugin generates several rewrites of its own, which are used to map paths from the site to different Netlify functions which handle SSR, preview mode and images, as well as assets in `/_next/static`. Any Netlify redirects or rewrites that you create [take precedence over these rewrites](#Redirect-and-rewrite-precedence), so you should avoid adding a root-level Netlify rewrite, because that would override the rewrites generated by and required by the plugin.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be useful to add an example of what you mean by a root-level Netlify rewrite.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point

@@ -42,7 +42,7 @@ If you are using a monorepo you will need to change `publish` to point to the fu

If you are using Nx, then you will need to point `publish` to the folder inside `dist`, e.g. `dist/apps/myapp/.next`.

If you currently use redirects or rewrites on your site, see [the Rewrites and Redirects guide](https://github.com/netlify/netlify-plugin-nextjs/blob/main/docs/rewrites-and-redirects.md) for information on changes to how they are handled in this version.
If you currently use redirects or rewrites on your site, see [the Rewrites and Redirects guide](https://github.com/netlify/netlify-plugin-nextjs/blob/main/docs/redirects-rewrites.md) for information on changes to how they are handled in this version.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link fix

@rstavchansky rstavchansky changed the title Docs: fix link to redirects & rewrites, minor edits docs: fix link to redirects & rewrites, minor edits Nov 8, 2021
@kodiakhq kodiakhq bot merged commit 1d52bf3 into main Nov 9, 2021
@kodiakhq kodiakhq bot deleted the rms/docsLinkFix branch November 9, 2021 08:58
@ascorbic
Copy link
Contributor

ascorbic commented Nov 9, 2021

I'll add the root level rewrite in a follow-up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: chore work needed to keep the product and development running smoothly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants