mastodon.nu är en av de många oberoende Mastodon-servrar som du kan använda för att delta i Fediversen.
Mastodon.nu etablerades 2021 och är den största servern i Norden samt öppen för alla. Den drivs ideellt på ett professionellt vis och med 100% förnybar energi. Välkommen! Velkommen! Tervetuloa!

Administrerad av:

Serverstatistik:

1,8K
aktiva användare

Philip Jägenstedt

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 foolip.org/blog/anything to foolip.org/anything. Next is rewriting (without redirect) foolip.org/wiki/something to 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.

@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 11ty.dev (static site generator)? It’s rather popular, so big chance it supports your redirect use cases.

i use lume.land for my site though, since i like deno :)

A screenshot of the web page at https://www.11ty.dev/
EleventyEleventy is a simpler static site generatorEleventy is a simpler static site generator.

@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.