Do single redirect rules work on Pages Custom domains, seems they dont.

Been trying to create a redirect rule with pages custom doamins, but seems it they only work with the primary domain, i have used trace and they dont pick up the rule on custom domains. i.e. my pages domain is mycompany.com, but custom domains are docs.customerA.com with a cname to my pages domain... hence any rules for the docs.customerA.com do not work -- is this by design.
6 Replies
Walshy
Walshy2w ago
Yeah this sounds by design. The request isn't technically going customera -> you -> pages It's going customera -> pages If it did pass through you, it would be invoked. I'd recommend using a Function
Ricky U
Ricky U2w ago
i tried bullk redirects, and when i enter docs.customerA.com the redirect works there, although if i have 500 custom domains (vanity urls for my saas) this could get out of hand. snippet?
Walshy
Walshy2w ago
Bulk redirect likely worked because it is passing through your account just not that zone. Snippet wouldn't be invoked by the customers zones either
Ricky U
Ricky U2w ago
hmm.. anything else off the top of your head. ]could i do a origin rule to check the host header url, and redirect based on that. -- but when i set up a origin rule it only allows me to check the port.
Walshy
Walshy2w ago
Nah I think your options are: * Use a Function * Use bulk redirects * Switch to Workers Assets and use SSL for SaaS
Ricky U
Ricky U7d ago
function i.e. workers... btw do workers now support native mongodb driver, last i tried it did not, but i know there has been recent changes i guess i would be creating a worker route that will check all routes, is there a sample somewhere i can follwo for redirect path on hostname. thanks walsh i ended up doing this in my own app. not ideal; did not know how to trigger the pages function on certain routes
Want results from more Discord servers?
Add your server