Gatsby trailing slash redirection

I am using gatsby generated static site for my website. I wanted to prevent redirection from non-trailing to trailing slash. One solution we implemented was to use a gatsby plugin to force non-trailing slash and disabled pretty URLs. but this causes both with and without slashed pages to return 200. I want to have my static site redirect 301 from trailing to non-trailing slash page.

Hey there, @smit0086 :wave:

Welcome to the Netlify Forums!

A good first stop would be the debugging redirects support guide, which I have linked here.

We also have this post on asset optimization and trailing slashes and our Docs outline redirects and rewrites as well.

If you are still having issues after using those resources, please respond with your site name and the additional debugging steps you tried, as well as any additional screenshots or images that would be useful!