#Help with apex domain redirect using Appwrite Sites

5 messages · Page 1 of 1 (latest)

manic oak
#

Can someone provide guidance on how to redirect traffic from apex/root domain to a www subdomain using Appwrite Sites as the DNS manager. What I've done so far:

  1. Changed the domain registrars nameservers to point at appwrite servers
  2. Created custom apex domain, verified, and targeting active deployment
  3. Created the www subdomain targeting the active deployment
  4. Created a DNS ALIAS record for apex domain pointing at www subdomain

The current configuration allows visitors to see/use both the apex and www subdomain. I would like all traffic following the apex domain to land on the www subdomain but can't find anyway of changing the target from "Active deployment" to "Redirect". Do I have to delete the apex domain from Appwrite Sites Console and re-create as a redirect? Does this cause issues/errors/downtime I should account for?

sterile hound
# manic oak Can someone provide guidance on how to redirect traffic from apex/root domain to...

I can help with this.
What’s happening is that Appwrite treats your apex and www as two separate domains pointing to the same deployment, so it serves both instead of redirecting. The DNS ALIAS you added only helps resolve the domain it doesn’t force a redirect.
Appwrite Sites doesn’t currently support setting a domain as a redirect in the dashboard, so even if you remove and re-add the apex, it will still behave the same way if it points to a deployment.
The fix is to handle the redirect outside DNS either inside your app (like a simple redirect rule) or through a proxy like Cloudflare. That’s what will actually force users from apex → www.
What are you deploying static site or something like Next.js?

manic oak
#

Ah thank you, that's great context! I use Namecheap as the domain registrar and I'm deploying a react native SPA using expo web build. Do you know how the Appwrite Sites "Domain rule types" work (active deployment, git branch and redirect), and why a "redirect rule" wouldn't work in this scenario? I'll explore your suggested alternatives, I was just hoping I wouldn't have to configure/manage another service to achieve the redirect. Cheers!

sterile hound
# manic oak Ah thank you, that's great context! I use Namecheap as the domain registrar and ...

Yeah that makes sense.
The “redirect rule” in Appwrite won’t work here because it doesn’t handle domain-level redirects like apex → www, only path-based ones. Since your apex is linked to an active deployment, Appwrite will always serve it instead of redirecting.
You don’t need anything complex, just a small external redirect setup to force it properly.
If you want, I can quickly set this up for you cleanly with no downtime 👍

manic oak
#

Appreciate the offer! I'm going to have a look at options. If it's too annoying for me, I'll reach out.