I’ve banned query strings

I’ve banned query strings

我封禁了查询字符串

I’ve banned query strings 🗓️ 2026-05-08 • Tagged /web, /opinions, /meta=only 我封禁了查询字符串 🗓️ 2026-05-08 • 标签 /web, /opinions, /meta=only

I don’t like people adding tracking stuff to URLs. Still less do I like people adding tracking stuff to my URLs. https://chrismorgan.info/no-query-strings?ref=example.com? Did I ask? If I wanted to know I’d look at the Referer header; and if it isn’t there, it’s probably for a good reason. 我不喜欢人们在 URL 中添加追踪信息。更不喜欢人们在我的 URL 中添加这些东西。比如 https://chrismorgan.info/no-query-strings?ref=example.com,我要求了吗?如果我想知道来源,我会去查看 Referer 请求头;如果那里没有信息,那通常是有正当理由的。

You abuse your users by adding that to the link. https://chrismorgan.info/no-query-strings?utm_source=example&utm_&c.? Hey! That one’s even worse, UTM parameters are for me to use, not you. Leave my URLs alone. 你在链接中添加这些参数是在滥用你的用户。比如 https://chrismorgan.info/no-query-strings?utm_source=example&utm_&c.?嘿!这个更过分,UTM 参数是给我用的,不是给你用的。别动我的 URL。

So I’ve decided to try a blanket ban for this site: no unauthorised query strings. At present I don’t use any query strings. If I ever start using any query strings, I’ll allow only known parameters. (In past times I used ?t=… and ?h=… cache-busting URLs for stylesheet URLs; and I decided I’m okay breaking such requests; there shouldn’t be any legitimate ones.) 所以我决定对本站实施全面封禁:禁止任何未经授权的查询字符串。目前我没有使用任何查询字符串。如果将来我开始使用,我也只会允许已知的参数。(过去我曾使用 ?t=…?h=… 作为样式表 URL 的缓存清除参数;但我决定即使破坏这些请求也没关系,因为它们本就不该存在。)

Want to see what happens if you add a query string? Go ahead, try it. It’s my website: I can do what I want with it. And you can do what you want with yours! This is currently implemented in my Caddyfile. 想看看如果你添加查询字符串会发生什么吗?尽管试试看。这是我的网站:我想怎么做就怎么做。而你的网站你想怎么做也随你!目前这已在我的 Caddyfile 中实现。