From 437097a71bc2e958185467a667b010b8bf388724 Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Fri, 7 Feb 2025 21:53:33 -0600 Subject: [PATCH] bert: Add chandlerswift.com cloudflare compat redir Cloudflare Pages, the previous home of this site, strips the `.html` suffix from filenames (no small part of the reason this site was moved!) e.g. a recent post would be served on https://chandlerswift.com/2024/11/12/install-lineageos-on-lemonade and not on https://chandlerswift.com/2024/11/12/install-lineageos-on-lemonade.html and the latter would be redirected to the former. To me, this seems like a perversion of file paths for no good reason, and it seems that a not-insubstantial chunk of the internet agrees: https://community.cloudflare.com/search?q=%22.html%22%20%23developers%3Acloudflare-pages This has been repeatedly considered "feature not bug" (despite examples of use cases the feature breaks), e.g. https://github.com/cloudflare/workers-sdk/issues/1488 This PR used AI assistance (and manual verification) for Caddyfile syntax: https://chatgpt.com/share/67a6d4e5-a464-800c-9c4d-910faa53b2dd --- bert/services/http/chandlerswift.com.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bert/services/http/chandlerswift.com.nix b/bert/services/http/chandlerswift.com.nix index 6bf8c04..b2f5ca1 100644 --- a/bert/services/http/chandlerswift.com.nix +++ b/bert/services/http/chandlerswift.com.nix @@ -6,6 +6,12 @@ root * /srv/www/chandlerswift.com # hide .git # ??? + @html_redirect { + file {path}.html + not path *.html + } + redir @html_redirect {path}.html 301 + redir /.well-known/host-meta* https://social.chandlerswift.com{uri} permanent redir /.well-known/webfinger* https://social.chandlerswift.com{uri} permanent redir /.well-known/nodeinfo* https://social.chandlerswift.com{uri} permanent