Cool URIs can be ugly (2023)
Cloudflare Pages’ automatic, permanent redirects from `.html` files to extension-less URLs have reignited debate over what makes web addresses “cool” and stable. Commenters weigh the benefits of clean, technology-agnostic URLs against the practical simplicity of exposing `.html`, worry about hosting providers mutating URL schemes without opt-out, and revisit the W3C ideal that links should remain valid for decades. The thread broadens into questions of link rot, redirects, REST-style paths vs query parameters, and whether exposing implementation details like file extensions meaningfully harms long-term maintainability.
Cloudflare / GitHub Behavior and Redirects
- Cloudflare Pages automatically redirects
.htmlto extension‑less URLs and treats them as permanent; some see this as a critical, invasive “feature” that should be opt‑in. - Others argue this is long‑standing behavior in many static hosts and web servers, driven by the mismatch between filesystem extensions and URL content types.
- Criticism centers on the permanence (301s) and lack of configuration options; supporters frame it as a product decision, not a bug.
- GitHub Pages has similar mapping rules (
/foo→foo.html, folder →folder/→folder/index.html), but generally without permanent redirects.
Cool URIs, Extensions, and Future‑Proofing
- The W3C “Cool URIs don’t change” stance against
.htmlis revisited. - Some agree extensions expose backend details and risk future breakage; others say
.htmlis stable enough and unlikely to change for typical sites. - A common pragmatic view: if you choose
.htmland keep it stable, that becomes the “cool” URL; switching backends should adapt to existing URLs, not vice versa. - Some frameworks even tie extensions directly to MIME types (
.json,.xml, etc.) as a debugging aid.
What Counts as an “Ugly” URL
- Many participants reserve “ugly” for long, parameter‑laden or hash‑encoded URLs, not simple
/year/slug.html. - Historical examples include comma‑infested CMS URLs, JSON blobs in fragments, tracking query strings, and complex enterprise app URLs.
- Static paths with IDs plus slugs (
/category/123/post-name) are seen as a good compromise: stable identifier plus human readability.
Redirects, Link Rot, and Responsibility
- One camp: site operators have no obligation to preserve URLs forever; “cool URIs” rhetoric can feel moralizing.
- Another camp: maintaining redirects is low effort and courteous; link rot is primarily caused by targets changing, not link authors.
- Some suggest even static‑site workflows can auto‑generate simple redirect pages or meta‑refreshes.
Implementation Details and Monitoring Concerns
- Popular pattern:
/blog/slug/directory withindex.html, sometimes used per‑post to hold related assets. - Content negotiation and alternative formats (Markdown, multilingual variants) often clash with static generators’ assumptions.
- Observability practitioners dislike putting user data in path segments, since it complicates metrics and logging; they prefer query parameters.
URIs vs URLs
- There’s a short historical recap of URIs, URLs, URNs, and their RFC lineage.
- Many agree that in everyday web work “URL” is the only practically useful term, even if “URI” is technically more general.