Redirect www to apex domain with Azure Static Websites not working

We are trying to achieve a redirect from www to apex domain for nomnommap .com however despite following numerous setup guides haven’t been successful.

The apex domain setup and CF proxying through to the Azure Static Website is working correctly, and the site loads correctly.

(Please ignore the whitespace in the domains, as a new member would not let me submit due to too many hyperlinks with them)

We have tried the following to get the www domain redirecting, none of which seem to work:

  • Add www as a CNAME pointing at nomnommap .com
  • Add www as a CNAME pointing at the Azure Static Website agreeable-desert-0fbea8610 .2.azurestaticapps.net
  • Both of the above with a Cloudflare Page Rule of source www.nomnommap .com/* Forwarding URL. Status Code: 301 - Permanent Redirect. Destination url: https://nomnommap .com/$1

Our other Cloudflare subdomains mapped to Azure Static Web Sites and Blob Storage are working fine (admin .nomnommap.com, ct .nomnommap.com, etc).

Appreciate any advice on resolving this.

DNS settings from CF:

Thanks,
Geoff

Your redirect is working ok…
https://cf.sjr.org.uk/tools/check?8944f9d270ec485ab4c489cff2ac6e52#connection-server-https

Try clearing your browser cache or using private/incognito mode if it’s not working for you.

For redirecting a whole (sub)domain, you can use a dummy proxied record in place of the CNAME for www (A 192.0.2.1 or AAAA 100:: ) to remind you that there is a redirect in place, and also so the request goes nowhere if you delete or disable the redirect by mistake.

Thanks SJR - I’m not sure what was going on there. I had flushed local DNS repeatedly, restarted browsers, etc over the course of about 40 minutes before posting…

Can confirm that now all seems to be ok. Appreciate the reply - thanks.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.