Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Leaving Vercel with a static site: the redirects you lose without noticing

This week I moved four static Astro sites off Vercel and onto a plain container host. The builds were the easy part: npm run build , copy dist/ into a web server image, done. What almost went wrong is everything Vercel had been doing around the build without my thinking about it. The failure that does not show up A static site on Vercel is not only a folder of HTML. vercel.json holds redirects,…

Moving four static Astro sites from Vercel to a plain container host proved more challenging than anticipated. While the build process was straightforward, the platform's automatic handling of redirects, headers, cleanUrls, trailingSlash, and language negotiation was not as simple to replicate. Vercel's infrastructure applied these settings at the edge, and copying the dist/ folder into a web server resulted in 404 errors for home pages, short links, and extensionless URLs.

Only upon months later did these issues become apparent in Search Console. The transition was made using Caddy, and key settings such as redirect order, patterns, host conditions, headers, and language negotiation needed to be manually translated. A Python script was developed to convert Vercel's vercel.json rules into Caddyfile configurations, but it has limitations and only handles static output. For complex sites with server-side rendering or functions, this approach is not suitable.

Rewritten by urgent.news; may contain errors — check the original.

Read the original at dev.to →

Report a problem with this story

More in Tech

Investigating consumer lag without guesswork

Hi everyone, we’ve created a new project called Broka that supports Kafka, RabbitMQ, Redis, ActiveMQ Artemis, and Memcached. If you don't mind, I’d love to walk you through it with a quick guide.

  • Consumer lag in Kafka does not imply a consumer is caught up even when it's 0.
  • Stable consumer lag indicates a backlog, while a changing lag signifies task redistribution.

Git at a hackathon: how to combine code and not lose your demo

На хакатоне Git помогает хранить общую историю проекта и соединять работу участников. Для небольшой команды достаточно простого порядка: основная ветка запускается, изменения делаются небольшими…

  • Git facilitates shared project history and combined work at hackathons
  • Establish main branch, make small changes, and review before merging
  • Use GitHub for collaboration, access control, and demo-ready versions

More from Wednesday 7 October →