Indexability and crawling
How to fix www and non-www serving the same site
Both www.yoursite and yoursite serve the site directly. Search engines treat them as two sites with identical content, which splits the value of every link you have ever earned between them.
What it is, and what it costs
Your domain can answer at the www and non-www hostnames. When both return the site with a 200 instead of one redirecting to the other, you have two full copies of every page. Links, rankings, and authority get divided across the pair instead of compounding on one.
How to fix it
Pick one form as canonical and make the other 301-redirect to it, at the server or CDN level.
- Nginx / Apache: add a permanent redirect from the non-preferred host to the preferred one.
- Cloudflare / host panel: most have a one-click "redirect www to root" (or the reverse) rule.
- WordPress: set your Site Address (Settings → General) to the form you chose; the redirect still needs to be enforced at the server or CDN.
How to check your site
Load both https://www.yoursite.com and https://yoursite.com. One should 301-redirect to the other, not both load independently.
Questions people ask
- www or non-www: which is better for SEO?
- Neither ranks better. Pick one, redirect the other, and stay consistent.
Does your site have this?
Check your site to see whether www and non-www are consolidated.
See also
- How to fix canonical tag problemsA canonical tag names the real URL for a page when the same content is reachable more than one way. Getting it wrong is quieter than most SEO faults: nothing on the page looks broken, and its value quietly goes to the wrong address — or to one that cannot rank at all.
- How to fix XML sitemap problemsA sitemap is how search engines discover pages your own links do not lead to well, and how they learn something changed. Two things go wrong with it: there is not one, or the one you have lists URLs that do not work.
- How to fix a page accidentally set to “noindex”If a page you care about is nowhere in Google, not even when you search its exact title, a noindex tag is the first thing to rule out. It is one line, it overrides everything else you do for that page, and it usually got there by accident.
- How to fix a robots.txt that blocks your whole siteDisallow: / in your robots.txt is the fastest way to disappear from search. It asks every crawler to skip the whole site at once, and it is a common leftover from launch day.