Rewrites with static site

Hello, I am using a rewrite for a static site but it appears to be redirecting any page that is not the homepage (ie click about and then refresh on about page sends you to homepage). I have tried a created a minimal test case with just the sveltekit demo app and the rewrite below (which I thought would work for a SPA). Just looking for any guidance as to why this may be happening.

Thank you!

Hey @joey,

The rewrite rule looks correct to me. Does it work locally? Can you share the repo used for the example site?

hey @jake

Thank you for taking a look and confirmed that it does work as intended on local. And sure, no problem, here’s the example repo:


I just wanted to circle back to this with something that I noticed when refreshing on the Render deploy. It continues to redirect with a rewrite but if I add a trailing slash to the url, then it no longer does redirects and it stays on the page as intended.

ie: vs

I tested on Netlify to see if I would run into the same results and I noticed that refreshing with the rewrite in place would keep me on the page as expected but add a trailing slash in the url:

I tried changing the trailing slash in the svelte config to never or always but it didn’t seem to make a difference: https://


(note: it wasn’t allowing me to reference the additional links in the post so i added a space)

Not exactly sure what I am missing here. Any guidance is much appreciated.

Thank you!