okay so I rewrote a website on NextJS and hosted it on Netlify and my SEO specialist told me that we need to make the urls standard and same as before so we need the trailing slash. I successfully added the trailing slash except for the homepage (that has basepath and it needs to stay that way). How can I make the redirect from example.com/test
to example.com/test/
?
Netlify config looks like this
# test
[[redirects]]
from = "/test"
to = "https://test.netlify.app/test/"
status = 200
force = true
[[redirects]]
from = "/test/*"
to = "https://test.netlify.app/test/:splat"
status = 200
force = true
We have other redirects like this so the initial server acts as a headless to redirect to others based on the basepaths. I also added trailingSlash: true
in nextjs config on every server so other paths work except for the one with basepath