惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Recent Announcements
Recent Announcements
雷峰网
雷峰网
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Hugging Face - Blog
Hugging Face - Blog
博客园 - 司徒正美
人人都是产品经理
人人都是产品经理
博客园 - 【当耐特】
量子位
有赞技术团队
有赞技术团队
博客园 - 三生石上(FineUI控件)
博客园 - Franky
M
MIT News - Artificial intelligence
U
Unit 42
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
The Cloudflare Blog
J
Java Code Geeks
V
Visual Studio Blog
Engineering at Meta
Engineering at Meta
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
MyScale Blog
MyScale Blog
T
Tailwind CSS Blog
T
The Blog of Author Tim Ferriss
V
V2EX

Red Blob Games: latest blog posts

Red Blob Games: English: a vs an Red Blob Games: Differential heuristics Red Blob Games: Responsive design calculator Red Blob Games: Academic citations Red Blob Games: Highlighting interactive code blocks Red Blob Games: Optimizing page size Red Blob Games: Writing a guide to SDF fonts Red Blob Games: What I did in 2025 Red Blob Games: Goodbye Sass Goodbye Sass Red Blob Games: RotMG map seeds Red Blob Games: Mapgen4 Mapgen4's use of WebGL2 Red Blob Games: Mapgen4 river shader Red Blob Games: Mapgen4 renderer Red Blob Games: Harnessing ChatGPT hallucinations Red Blob Games: Let Let's write a search engine, part 2 of 2 Red Blob Games: Let Let's write a search engine, part 1 of 2 Red Blob Games: Hexagon conversions Red Blob Games: Mapgen4 trade routes Red Blob Games: De-optimizing mapgen4 Red Blob Games: Hexagon spiral coordinates Red Blob Games: Thoughts on Flash Red Blob Games: What I did in 2024 Red Blob Games: Hexagon page animations Red Blob Games: SDF Halos SDF Halos Red Blob Games: SDF headless tests, part 2
Red Blob Games: URLs with trailing punctuation
2026-02-13 · via Red Blob Games: latest blog posts
Blog post: 12 Feb 2026

When a url is posted on a forum/chat, it’s often automatically made linkable. But sometimes the regexp that grabs the url also grabs a trailing punctuation mark. For example, if the text is “visit red blob (https://www.redblobgames.com) and scroll to the bottom” and regexp picks up the trailing parenthesis, it will make “https://www.redblobgames.com)” clickable. When you click on this, it will request GET /) which will be a 404 error.

I don’t get a lot of these in my server error logs but it’s easy to do something about it.

I use both nginx and Caddy for my web sites.

In nginx I can put a permanent rewrite inside the server block:

server {
    …
    rewrite ^(.*)[\;:,.)]$ $1 permanent;
}

In Caddy the syntax is different:

https://www.redblobgames.com {
    
    @trailing_punctuation path_regexp url ^(.*?)[;:.,\)]$
    redir @trailing_punctuation {re.url.1} 301
}

Now it will 301-redirect “https://www.redblobgames/)” to “https://www.redblobgames/”.

For both of these web servers, I never remember what characters need to be escaped, and I kind of wish I could use existing programming language syntax with delimiters like /^(.*)[;:,.)]$/ or r'^(.*)[;:,.)]$'.