Redirect from non www to www not working

I have a custom domain and the non www domain is set to redirect to the www domain and when clicked, it runs a way older build of the site instead of directing to the www domain. The primary domain, that uses www, correctly directs to the current build.

netlify site name: uslegalnurseconsultants.netlify.app
primary domain: www.uslegalnurseconsultants.com
secondary: uslegalnurseconsultants.com

I have removed and re-added the domain back to netlify and swapped my primary domain around as some basic trouble shootings but I am at a loss for how to fix this.

Thanks for the help!

HI @allfizznobuzz

The redirect from https://uslegalnurseconsultants.com to https://www.uslegalnurseconsultants.com does work (for me) both in the browser and using cURL (see below.)

Quite likely you have a local cache issue now. Have you tried a different browser, private/incognito window, and or different device/network?


cURL result

curl -IL https://uslegalnurseconsultants.com
HTTP/2 301
age: 32
cache-control: public, max-age=0, must-revalidate
content-type: text/plain
date: Sun, 14 Aug 2022 04:18:41 GMT
location: https://www.uslegalnurseconsultants.com/    # <-- redirect here
server: Netlify
strict-transport-security: max-age=31536000
x-nf-request-id: 01GAD97JVX14QQB50YMZ6KVK08
content-length: 55

HTTP/2 200
age: 0
cache-control: public, max-age=0, must-revalidate
content-type: text/html; charset=UTF-8
date: Sun, 14 Aug 2022 04:19:13 GMT
etag: "c92f2c6c84cae56edfb02ca09ffff6f5-ssl"
server: Netlify
strict-transport-security: max-age=31536000
x-nf-request-id: 01GAD97K05DPTH7BP69QWCBTBM
1 Like

You are correct, It is a problem with my local cache! Thanks for the quick help!