Redirect rule not working
Hi, I have created a redirect URL for the hostname
doc.example.com
and docs.example.com
.
It is redirecting for doc
, but not docs
.
What could be the issue here? (Both subdomains have the same CNAME record)4 Replies
What's your redirect rule, and what's the error you get on docs (Nxdomain, cloudflare error page, etc)?
There is no error page, it just loads the CNAME domain instead of redirecting.
(http.host eq "docs.example.com") or (http.host eq "doc.example.com")
Static redirect to https://example.com/docs/
One difference is that doc.example.com responds with 404 and docs.example.com with 200, without the redirect.
Though, that shouldn't matter as the redirect should happen before it hits the CNAME server.
Hm, the moment I remove the domain from readthedocs.org, it works.
How is that possible? (cache was already cleared)Even if you cleared your local cache, your DNS Resolver (espec if it's an ISP, those sometimes ignore TTLs) could still be caching it. It could also be because readthedocs may be using CF For SaaS which overrides some domain settings, but if it worked on the other subdomain and it was also added, probably not
if you're using the entire subdomain for redirects, just use an originless record like
AAAA
docs
100::
Proxied
readthedocs may be using CF For SaaS which overrides some domainAh, that could be it and it would explain why it works when I remove the domain from their control panel. (They do mention CF too) https://docs.readthedocs.io/en/stable/custom-domains.html#how-custom-domains-work