trailingSlashoption available in your
gatsby-config.js. For Gatsby v4, the default for this is
legacy, which preserves what URL was provided. In Gatsby v5, the default for this is
always, which will redirect all URLs to ones with trailing slashes.
netlify.tomlin the root of your repository, or manually in the Netlify UI. We'll leave it up to you to pick the method that works best for you, though we favor
netlify.toml. Further installation instructions can be found in the links above.
gatsby-plugin-netlifyand add it to your
gatsby-config.jsso that Gatsby can generate Netlify specific artifacts as a part of its build. This plugin is included by default in our starters; you should just check that it's there and add it if not.
index.htmlfiles living inside of a folder that matches the request path. Using the above example of
https://example.com/shop, that page actually exists in the filesystem as
/shop/index.html. For legacy web reasons,
index.htmlhas a special meaning to web servers that, when requesting a directory, return the
/shop/is requested. All this to say that Netlify is able to do trailing slashes out of the box because of how web servers work.
200 Okresponse is returned instead of a