AWS Amplify

Redirect Your Apex Domain to AWS Amplify Hosting

Amplify Hosting handles apex domains automatically if your DNS is on Route 53. If it isn't, you hit the same CNAME-at-apex wall as everywhere else. ApexToWWW fixes that without migrating your DNS — free, with IPv6 and HTTP/3.

Jump to Setup
TL;DR

If your domain is on Route 53, Amplify auto-manages the apex for you. If your DNS is external, the apex still can't take a CNAME per RFC 1034. Point www to Amplify via CNAME, then redirect apex to www using ApexToWWW. Free, no Route 53 migration, automatic SSL.

Amplify's Official Approach

AWS Amplify Hosting handles custom domains differently depending on where your DNS lives.

If your domain's DNS is hosted in Route 53 (in the same AWS account, or delegated to it), Amplify's domain management does the heavy lifting. When you add a domain in App settings → Domain management, Amplify automatically creates the Route 53 records it needs — including an ALIAS record at the apex, which Route 53 supports natively and which behaves like a CNAME even though DNS itself doesn't allow one there. This "just works" with no manual DNS steps on your part.

If your DNS is external — Cloudflare, GoDaddy, Namecheap, or any registrar not delegated to Route 53 — Amplify gives you a verification CNAME and a target hostname for each subdomain you add. That's straightforward for www. But the apex domain still can't take a CNAME per RFC 1034, and unless your external DNS provider happens to support ALIAS/ANAME/CNAME flattening itself, Amplify's standard flow has no way to serve the apex directly.

The ApexToWWW Approach — Step by Step

This setup keeps your Amplify app on www.yourdomain.com using Amplify's standard external-DNS flow, and uses ApexToWWW to handle the apex 301 redirect — no Route 53 migration needed. Total time: about 5 minutes plus DNS propagation.

  1. Step 1. In the Amplify Console, open your app, go to App settings → Domain management → Add domain, and add www.yourdomain.com as a subdomain.
  2. Step 2. Amplify displays a verification CNAME and a target hostname (or CNAME) for www. Copy both.
  3. Step 3. In your external DNS provider, add the verification CNAME and the www CNAME pointing to the targets Amplify provided.
  4. Step 4. Add an A record: host @, value 65.21.184.101.
  5. Step 5. Add an AAAA record: host @, value 2a01:4f9:c012:a304::1.
  6. Step 6. Wait for Amplify to verify www and provision its ACM certificate (usually a few minutes, occasionally longer).
  7. Step 7. Test: curl -I https://yourdomain.com → you should see HTTP/2 301 with a Location header pointing at https://www.yourdomain.com/.

DNS Records Summary

Type Name Value
A @ 65.21.184.101
AAAA @ 2a01:4f9:c012:a304::1
CNAME www (Amplify target)

Comparison: Route 53 Auto-Apex vs ApexToWWW

Approach Needs Route 53 IPv6 HTTP/3 Apex SSL
Amplify + Route 53 ALIAS Yes, required Yes Yes Yes
ApexToWWW redirect No Yes Yes Yes

When to Use Amplify's Native Route 53 Apex Instead

The ApexToWWW redirect pattern is not always the right choice. Use Amplify's native Route 53 setup if:

  • Your DNS is already on Route 53, or you're fine consolidating DNS management into AWS alongside your Amplify app. Amplify's auto-managed ALIAS record serves your app directly on the apex — no redirect hop.
  • You want the apex as your canonical URL with no www redirect at all, and you're comfortable with Route 53 as your authoritative DNS.
  • You want everything — DNS, hosting, certificates — inside one AWS account for consolidated billing and IAM-based access control.

Otherwise, if you want to keep DNS where it is (Cloudflare, GoDaddy, your registrar's built-in DNS) and still get a working, standards-compliant apex, ApexToWWW is the faster path.

Other Hosting Platforms

The same pattern works for any platform that prefers a CNAME on www:

Frequently Asked Questions

Do I need to move my domain to Route 53 to use Amplify?

No. If your domain is already in Route 53, Amplify can automatically manage both the apex and www records for you. But if your DNS is external (Cloudflare, GoDaddy, Namecheap, etc.), you can keep it there: point www at Amplify via CNAME and use ApexToWWW for the apex redirect. No migration required.

Does this work with Amplify branch deployments and preview URLs?

Yes, unaffected. Amplify's branch deployments and pull request previews use auto-generated amplifyapp.com subdomains that are entirely separate from your custom domain. The apex redirect only applies to yourdomain.com.

How does SSL certificate handling work?

Amplify provisions and auto-renews an AWS Certificate Manager (ACM) certificate for every domain you add in the console, including www.yourdomain.com. ApexToWWW separately provisions and auto-renews a Let's Encrypt certificate for the apex. Both are fully automatic.

Does this affect Amplify rewrites and redirects rules?

No. Amplify's rewrites and redirects configuration is applied at the app level after a request reaches Amplify's edge. The apex redirect happens entirely outside Amplify, before the request ever gets there, so your app-level rewrite rules on www work exactly as configured.

Ready to Set Up Your Amplify Apex Redirect?

Add two DNS records and your naked domain redirects to your Amplify app over HTTPS. Free, no signup, no Route 53 required.

Get Started Now

Questions? Email hi@apextowww.com