Technical SEO

Should Your Website Use WWW or Non-WWW?

Learn why www and non-www versions of your website should redirect to one preferred hostname, how to test it, and what to fix if both versions load.

Open your website with www in front of the domain. Then open it again without www.

For example:

https://www.example.com/
https://example.com/

One of those should automatically redirect to the other. If both versions load normally, your site is sending search engines two different addresses for the same content.

This is common, especially on small business sites that have moved between hosting providers, changed DNS settings, or added SSL later. It usually is not an emergency, but it is worth fixing. A clean setup gives every page one preferred address, which makes your technical SEO easier to manage and your reports easier to trust.

By the end of this guide, you will know which version to choose, how the redirect should behave, how to test it, and which other places need to match the same hostname.

WWW and non-WWW are different URLs

People tend to see these as the same website:

https://www.example.com/services/
https://example.com/services/

Technically, they are two different URLs on two different hostnames. The www part is a subdomain, the same way blog.example.com or shop.example.com would be a subdomain.

Your visitors may not care which one they use. Search engines do care, because they need to decide which exact URL should be stored in the index and shown in search results.

If both versions return a successful 200 OK response, both are accessible. That means every public page may have a duplicate version:

https://example.com/about/
https://www.example.com/about/

https://example.com/contact/
https://www.example.com/contact/

https://example.com/services/
https://www.example.com/services/

Google can often work out that these are duplicates. You should still avoid making Google guess when the fix is straightforward.

Why this creates a technical SEO problem

A split between www and non-www usually causes quiet problems rather than a dramatic traffic crash. Those quiet problems are still worth cleaning up.

Ranking signals can be split

Other websites may link to different versions of your domain.

Local directory -> https://example.com/
Partner website -> https://www.example.com/

Those links are backlinks, which are links from other websites to yours. Backlinks can help search engines understand that your site is trusted or useful.

Google is good at consolidating duplicate URLs when the signals are clear. A permanent redirect makes the signal clearer. It tells browsers, visitors, crawlers, and SEO tools which hostname is the real destination.

Duplicate URLs waste attention

Duplicate www and non-www pages do not normally cause a Google penalty by themselves. The bigger issue is clutter.

Each duplicate URL is another version for a crawler to discover, fetch, compare, and consolidate. On a small five-page site, that may barely matter. On a site with hundreds or thousands of pages, faceted filters, blog archives, location pages, or ecommerce products, duplicate hostnames can make crawl reports noisy fast.

Clean technical SEO is partly about removing pointless choices. One page should have one preferred URL.

Google may pick the version you do not use

When Google finds duplicate pages, it chooses a canonical URL. A canonical URL is the version Google treats as the main one.

If your internal links use https://example.com/, your sitemap uses https://www.example.com/, and both hostnames load, Google has to choose between mixed signals. It may select the version that does not match your branding, your email campaigns, or your internal reporting.

That mismatch can be annoying. You may see the wrong hostname in search results, or you may find that Search Console data is split across different URL-prefix properties.

SEO reports become harder to read

Technical SEO tools often report issues by URL. If both hostnames are crawlable, the same problem can appear twice:

  • Missing title tag on https://example.com/services/
  • Missing title tag on https://www.example.com/services/

Analytics tools can also split data if they are configured around one hostname and users arrive through the other. Google Search Console is easier now that Domain properties cover the full domain, but URL-prefix properties, backlinks, and third-party tools can still show the two versions separately.

Cleaner inputs produce cleaner reports. That matters when you are trying to decide what to fix first.

Should you choose WWW or non-WWW?

Choose the version that best matches how your business already uses the site.

There is no meaningful SEO advantage to www over non-www, or the other way around. Search engines can rank either version perfectly well. The important part is consistency.

Use the non-www version if that is what appears in your branding, printed materials, business listings, email signatures, and internal links:

https://example.com/

Use the www version if your site and existing marketing already lean that way:

https://www.example.com/

For a brand-new site, non-www is often cleaner and shorter. For an established site, avoid changing purely for taste. A hostname switch is a site-wide URL migration, so only change it when there is a real reason.

The correct fix: redirect one version to the other

Once you choose a preferred hostname, permanently redirect the other version to it.

If non-www is preferred:

https://www.example.com/
        -> 301 or 308
https://example.com/

If www is preferred:

https://example.com/
        -> 301 or 308
https://www.example.com/

A 301 Moved Permanently redirect is the common choice for SEO redirects. A 308 Permanent Redirect can also be correct. Both tell crawlers that the move is permanent.

Avoid 302 or 307 redirects for this job. Those are temporary redirects, and a permanent hostname preference should not look temporary.

The redirect can happen at your hosting provider, CDN, web server, or application layer. The best place depends on your setup. For many small business sites, the hosting or CDN setting is the simplest and safest place to configure it.

Preserve the full URL

The redirect should preserve the path and any useful query string.

This is correct:

https://www.example.com/services/web-design/?source=newsletter
        -> 301
https://example.com/services/web-design/?source=newsletter

This is wrong:

https://www.example.com/services/web-design/
        -> 301
https://example.com/

Redirecting every old URL to the homepage is a common mistake. It frustrates visitors and weakens the redirect because the destination is no longer the matching page.

Each non-preferred URL should point to its equivalent preferred URL. Homepage to homepage. Service page to service page. Blog post to blog post.

Use canonical tags too

A canonical tag is a small line of HTML that names the preferred URL for a page:

<link rel="canonical" href="https://example.com/services/" />

Canonical tags are useful, but they are signals. Redirects are stronger because they prevent the duplicate page from staying independently accessible.

The strongest setup uses both:

  • The non-preferred hostname redirects to the preferred hostname.
  • Each page has a self-referencing canonical tag using the preferred hostname.
  • Internal links point to the preferred hostname.
  • The XML sitemap lists only preferred URLs.

When those pieces agree, search engines have very little ambiguity to resolve.

Keep the hostname consistent everywhere

After the redirect works, check the rest of your site and marketing stack.

Use the preferred hostname in:

  • Internal links
  • Canonical tags
  • XML sitemaps
  • Structured data
  • Open Graph and social sharing tags
  • Google Search Console
  • Google Business Profile
  • Analytics settings
  • Email templates
  • Social media profiles
  • Business directories
  • Ads and campaign URLs
  • Any external listings you can edit

You do not need to chase every old backlink on the internet. The redirect will handle links you cannot control. Focus on the places you can edit, especially your own site, sitemap, business profiles, and major directories.

How to test your WWW redirect

Test more than the homepage. A redirect can work on / and fail on deeper URLs.

Check these four versions:

http://example.com/
http://www.example.com/
https://example.com/
https://www.example.com/

Then test at least one internal page:

http://www.example.com/services/
https://www.example.com/services/?source=test

The non-preferred version should:

  1. Return a permanent 301 or 308 status.
  2. Redirect in one step where possible.
  3. Preserve the page path.
  4. Preserve useful query parameters.
  5. End on HTTPS.
  6. Avoid redirect loops.

A clean result might look like this:

http://www.example.com/services/
        -> 301
https://example.com/services/

A less clean result might look like this:

http://www.example.com/services/
        -> 301
https://www.example.com/services/
        -> 301
https://example.com/services/

The final destination is correct, but the extra hop is slower and messier. If your hosting setup allows it, combine protocol and hostname redirects into one step.

You can test this with a browser, but a redirect checker or command-line request gives clearer status codes. If you are comfortable with a terminal, run:

curl -I -L https://www.example.com/services/

Look for the chain of 301, 308, and final 200 responses. The final 200 should be the preferred HTTPS URL.

Common mistakes

Letting both versions return 200. This is the core issue. If www and non-www both load without redirecting, your site has duplicate hostnames.

Redirecting all pages to the homepage. Preserve the matching page. A visitor trying to reach /pricing/ should land on /pricing/, not the homepage.

Using a temporary redirect. A permanent hostname choice should use 301 or 308, not 302 or 307.

Fixing the homepage only. Internal pages need to redirect too. Test service pages, blog posts, product pages, and any important landing pages.

Mixing signals after the redirect. If the redirect points to non-www but your sitemap and canonical tags still use www, you have cleaned up one problem while leaving another behind.

Changing hostname preference without planning. Moving an established site from www to non-www, or the reverse, affects every URL. Treat it like a migration and update links, sitemaps, canonical tags, analytics, and Search Console at the same time.

Practical next step: run a 10-minute hostname check

Pick your preferred hostname, then test your site in this order:

  1. Open the homepage with and without www.
  2. Open one important internal page with and without www.
  3. Confirm the non-preferred version redirects with 301 or 308.
  4. Confirm the redirect lands on the same path, not the homepage.
  5. Check your XML sitemap and canonical tags for the same preferred hostname.
  6. Update internal links and business profiles where you control them.

If both versions still load, ask your developer or hosting provider to add a permanent hostname redirect. Send them your preferred version and one example path that must be preserved, such as:

Redirect https://www.example.com/services/ to https://example.com/services/

That one example removes most of the confusion and makes the required behavior specific.

This is one of several quick technical checks worth running on a regular basis, alongside the 5-minute website health check and a look at whether PageSpeed Insights actually affects your rankings.

FAQ

Is WWW better for SEO?

No. Search engines do not inherently favor www or non-www domains. Choose one version and use it consistently.

Will having both versions cause a Google penalty?

Usually, no. Duplicate www and non-www versions are a technical SEO cleanup issue, not a manual penalty by default. The risk is ambiguity, duplicate URLs, split signals, and messier reporting.

Can I switch from WWW to non-WWW later?

Yes, but treat it as a site-wide URL migration. Configure permanent redirects, update internal links, regenerate your sitemap, check canonical tags, and monitor Search Console after the change.

Do I need both versions in Google Search Console?

A Domain property covers the domain across protocols and subdomains, including www and non-www. URL-prefix properties can still be useful if you want separate reporting for a specific hostname.

How do I know which version my site currently prefers?

Check your redirects, internal links, canonical tags, and XML sitemap. If they all point to the same hostname, that is your preferred version. If they disagree, pick one and make the rest match.