Menu

1 / 5

Trailing slashes in a static Astro site on Vercel: five layers and a check that never failed

DEV Community: astro·Seppe Gadeyne·28 days ago
#Jwqy36So
#devtoastro#devto#dev#astro#slash
Long article (1695 words) — no AI summary yet.
Reading 0:00
15s threshold

On straffesites.com , every page has exactly one URL, and that URL has no trailing slash: /en/blog/website-without-cms , never /en/blog/website-without-cms/ . The site is a static Astro 7 build (Astro 7.2.8 at the time of writing) deployed on Vercel. Setting trailingSlash: 'never' looks like a one-line decision. In practice it touches five places: the Astro config, the host, the dev server, the canonical tag, and a build check.

This article walks through each layer with the code from that project, the output from real requests, and two things I got wrong. One of them is a build check that passed on every route for two months without checking anything.

1.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.