Custom Domains
Point your own domain at a deployed theme and keep canonical URLs correct.
1. Set the site URL first
Before pointing DNS, update astro.config.mjs and redeploy. Canonical tags, the sitemap and the RSS feed are generated from this value:
export default defineConfig({
site: 'https://your-domain.com',
});2. Add the domain to your host
On Cloudflare Pages: your project → Custom domains → Set up a domain. The dashboard tells you the record to create.
3. Create the DNS record
| Type | Name | Target | | --
www | your-project.pages.dev |
| CNAME | store | your-project.pages.dev |A subdomain takes a CNAME pointing at the deployment host. For an apex domain (example.com with no subdomain), use your provider's flattening feature — Cloudflare calls it CNAME flattening — or the ALIAS/ANAME record type if they offer one.
4. Wait, then verify
DNS changes propagate in minutes to a few hours. Check whether a record is live before assuming the deploy is broken:
dig +short store.your-domain.comAn empty response means the record has not propagated yet. Certificates are issued automatically once it has.
Hand-built Astro themes — SaaS, storefront, portfolio, and dashboard.