AstroSEO.io

Deployment ยท 2026-06-07

Custom Domain Setup for Astro on GitHub Pages

Connect a custom domain to an Astro GitHub Pages site and keep canonical URLs consistent.

Why this matters

When a site moves from a GitHub Pages URL to a custom domain, canonical URLs and metadata need to move too.

Setup

Configure the domain in GitHub Pages settings and add the required DNS records with your domain provider.

Implementation notes

After the domain is active, update the Astro site URL and rebuild. Check that canonical tags, Open Graph URLs, RSS, and sitemap entries use the custom domain.

Final checklist

  • DNS points to GitHub Pages
  • Site config uses the custom domain
  • Sitemap URLs are updated

Related posts