What should I use to deploy a static web site with a node build step and that has complex redirect and rewrite rules to keep lots of old URLs working? Most options I look at don’t have redirect/rewrite as capable as nginx or apache.
Asking for foolip.org, but we also need something very similar for whatwg.org.
The simplest case that usually isn’t supported in docs is stripping a prefix by redirecting https://foolip.org/blog/anything to https://foolip.org/anything. Next is rewriting (without redirect) https://foolip.org/wiki/something to https://foolip.org/wiki/something.html.
The latter could be done with a storage bucket with the right headers configured to serve it as text/html, but doing it with a rewrite would be nice.
The answer was Cloudflare Pages, which supports thousands of redirects in a _redirects file. And it deploys from push to GitHub, with status written back to GitHub.
@foolip I believe Netlify can do all these things. See https://github.com/domenic/blog.domenic.me/blob/main/netlify.toml
@domenic I’ll take a look! Do you think it would work for WHATWG hosting too?
@foolip Yeah, at least for the static services. The problem is just whether we want to spread over all of DigitalOcean, AWS, and Netlify...
@foolip did you have a look at https://www.11ty.dev (static site generator)? It’s rather popular, so big chance it supports your redirect use cases.
i use https://lume.land for my site though, since i like deno :)
@brookie I assumed that, like most SSGs, is a build step. Is it also a server? The page mentions Netlify, do you use that then?
@foolip no server, only static pages. i use github pages, but i’m sure netlify has a ton of Advanced Features(tm) for redirects.
maybe cloudflare pages support that too? they have their workers feature too, which can intercept and redirect requests.
@brookie thanks, I’ll investigate Netlify and Cloudflare. Anything with edge functions would allow implementing redirects and rewrites as a function, but I’m trying to keep it as simple as possible.
@foolip I'd try Eleventy + Netlify. There's a pretty sophisticated system for redirects https://docs.netlify.com/routing/redirects/, and it takes just a few clicks to set up based on the GitHub repo.