I spelled all 106 of our URLs eight ways, and only one spelling that should work gets a 404

2026-12-02来源 dev.toEnglish

Every site gets linked to in ways its owner did not write. A newsletter lowercases a slug, a forum adds a slash, a QR code appends utm_source, someone types www. out of habit. The sitemap lists one spelling per page. What the server does with the other spellings is a decision that nobody made on purpose, and I had never counted it for nakodo.app.

So I took the 106 URLs in /sitemap.xml, spelled each one eight ways, and sent 848 requests with curl, eight at a time. No redirects followed: I wanted the first answer.

The table

Spelling of /pricing What came back, across all 106 pages
as listed 106 × 200
/PRICING 105 × 404, 1 × 200
/pricing/ 105 × 308 to the clean URL, 1 × 200
//pricing 106 × 308 to the clean URL
/pricing?utm_source=x&fbclid=y 106 × 200
/pricing%20 106 × 404
https://www.nakodo.app/pricing 106 × 307 to the apex
http://nakodo.app/pricing 106 × 308 to https

The two "1 × 200" rows are the home page. / uppercased is still /, and a slash on / is no change at all, so they pass trivially.

What I did not expect

Uppercase is a 404, not a redirect. /PRICING and /Guides/How-To-Find-Influencers both answer 404. That is the correct reading of the URL standard, because paths are case sensitive, and Next.js follows it. But it is the one spelling on the list that a human or a mail client does produce, since some of them capitalise the start of a link. The 404 page is our field guide entry for a bird that was never recorded, and it is marked noindex, so nothing damaging happens. A link that works in one email client and 404s in another is just a lost visitor.

The 404 is cached. curl -I https://nakodo.app/PRICING showed age: 141365 and cache-control: public, max-age=0, must-revalidate. That is the same prerendered 404 page, served from Vercel's cache with an etag and a last-modified of 30 November, 39 hours old, and revalidated on every request. A typo costs the server nothing.

www is a 307 and http is a 308. The rule for http is permanent. The rule for www is temporary. Both end up at https://nakodo.app/<path> with the path intact in all 106 cases. A client that remembers a 308 will skip the hop next time. A 307 means it will ask again every time. The chain from http://www.nakodo.app/pricing takes two hops: 308 to https://www., then 307 to the apex. Nothing in the repo sets that redirect, so it comes from how the www host is configured with the host, not from code. Whether it can be made permanent is something I still have to check there.

A tracking query changes nothing. All 106 URLs answer 200 with ?utm_source=x&fbclid=y, and the canonical link on the response stays the clean URL. For a static page like /guides/how-to-find-influencers the response is a cache hit, with the same age as the clean URL, so the query string shares the cache entry. /pricing is different, because it renders per request for the visitor's currency, so both spellings are a MISS with cache-control: private, no-store. That is the cost of showing a price in pounds, euros or dollars in the HTML.

A trailing space is a 404. /pricing%20 is not normalised. I tried .html and /index too, and those 404 as well, which is right: we never served them.

What is cheap to fix and what is not

Finding Fix Cost
uppercase 404s lowercase redirect in proxy.ts one more branch in the file that already owns the public-path allowlist
www is 307 check the host's domain setting outside the repo
404s are cached none needed nothing to do

I will leave the uppercase decision alone for now. The honest argument for a redirect is that it turns a lost visitor into a found one. The argument against is that it creates a second URL for every page that a crawler can discover and has to be told not to treat as a duplicate. The sitemap lists lowercase only, the canonical is lowercase, and I have no evidence yet that anyone is arriving by an uppercase link. If that changes, it is a small branch.

You can run the census yourself. The script is one curl -s -o /dev/null -w "%{http_code} %{redirect_url}" per spelling.

原文:https://www.a8q9.cn/en/article/i-spelled-all-106-of-our-urls-eight-ways-and-only-one-spelling-that-should-work--388fbb.html

相关文章