Disable Generated Site redirect

So I have noticed that glitch redirects the generated static site to root when the file for the path doesn’t exist, but I don’t want this behavior, I want to display a 404 page when the url doesn’t exist, and it is being an issue, since the path I have doesn’t correspond to an actual file, since I use react-router.

Is there a way to disable the redirect?

1 Like

There’s a way for everything :sparkles:

While I couldn’t make a working solution for a static site (i’m sure there’s a way and you can email support@glitch.com to figure it out), I did find this very interesting forum post on how to convert your static site to a server project (and get the custom 404 working).

There are some downsides such as no more 24/7 uptime :frowning: but it’s the only solution I could find. I hope this helps. Let me know if you figure something else out, I’d love to hear it!

Another option is using service workers, although this’ll only work if the user has already visited your site.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.