www vs non-www: pick one and redirect the other
Your site can usually be reached at both example.com and www.example.com. Search engines treat these as two different sites unless one redirects to the other.
Why it matters
When both versions load, links and ranking signals are split between them and pages can be indexed twice.
Chains of redirects (for example http:// → https:// → www) slow down every visit and can stop crawlers before they reach the final page.
How to fix it
- Choose one version. Either is fine for SEO; just be consistent.
- Add a permanent 301 redirect from the other hostname to the matching URL on your chosen one, keeping the path.
- Redirect
http://straight to the finalhttps://hostname in one hop. - Use the chosen hostname in canonical tags, internal links and your sitemap.
server {
server_name www.example.com;
return 301 https://example.com$request_uri;
}