How Do I redirect all urls to their trailing slash equivalent?

Hi! Anyone know how to take any url and if the pathname doesn't end with a trailing slash, redirect it to the same url with a the slash (with params)? example: /blogs should redirect to /blogs/ and /blogs?page=2 to /blogs/?page=2
2 Replies
Dynamore
Dynamore6mo ago
@jdkdev did you figure out how to resolve this? im trying to do this redirect also with my astro project. the default trailing slash redirection from cloudflare seems to work if the site is statically rendered. i needed to do SSR though, and it stopped working for me
jdkdev
jdkdevOP6mo ago
Hey @Dynamore , sorry no luck yet.
Want results from more Discord servers?
Add your server