DEV Community

Cover image for Migrating a static HTML site to Astro without changing a single URL
Muhammad Mustafa
Muhammad Mustafa

Posted on

Migrating a static HTML site to Astro without changing a single URL

My site had 50+ handwritten HTML pages with the same header pasted into 51 files. I moved it to Astro in a day.

The one setting that kept every URL identical:

// astro.config.mjs
export default defineConfig({
  build: { format: "preserve" }, // pricing.astro -> pricing.html
  compressHTML: false,
});
Enter fullscreen mode Exit fullscreen mode

Before going live, a parity script compared every page with production: titles, meta, canonical, JSON-LD, headings, body text, links, and images. It showed 0 differences, so I shipped.

Live: https://aisaaswithmustafa.com

Top comments (0)