GMax Mart
Home Services Pricing Portfolio FAQ Reviews Blog Support Careers Change Language

Hosting & Infrastructure

Domain setup basics: www vs non-www, redirects and HTTPS

· 6 min read

Domain setup basics: www vs non-www, redirects and HTTPS

Type your business address four ways and you may reach four technically different websites: with and without www, each over http and https. If all four answer, search engines see duplicate copies, your analytics splits, and a customer who bookmarked the insecure version keeps landing on a warning. Settling the www vs non-www question and redirecting everything else to one address is a small, permanent improvement that most sites never quite finish.

This guide explains how to choose, how to enforce the choice at each layer, and how to check that it holds.

Does www or non-www actually matter for SEO?

Neither is better for ranking. Search engines handle both perfectly well, provided you are consistent and the other variant redirects properly. What harms you is serving the same pages at two addresses with no redirect, which splits signals and confuses reporting.

There are two practical differences worth knowing.

A technical point about DNS

A bare domain such as example.in traditionally cannot hold a CNAME record, which some hosting platforms and CDNs want. Providers work around this with ALIAS or ANAME records, but if your platform insists on a CNAME for the main address, www is the simpler option.

A point about cookies

Cookies set on a bare domain are also sent to every subdomain, including a blog or help subdomain on another platform. Using www keeps that boundary cleaner. For most small sites this is a minor consideration.

The practical rule: if your brand already appears without www on cards and packaging, keep it that way. If the site is already indexed with www and ranking, do not change it for cosmetic reasons.

Pick one preferred domain and write it down

Decide, then record the decision somewhere the whole team sees it, because the damage comes from inconsistency rather than from either option. Once chosen, use the preferred form everywhere:

  • Internal links and menus, so visitors are not redirected on every click.
  • Canonical tags, the sitemap and the robots file.
  • Email signatures, invoices, printed material and Google Business Profile.
  • Advertising landing page URLs and social profile links.
  • The site URL setting inside your CMS or application configuration.

Redirects work, but every extra hop costs a little speed on mobile connections, and redirect chains occasionally break tracking parameters.

Redirecting the other variants correctly

You want exactly one redirect hop from any variant to the final address. Use a 301 permanent redirect, which tells browsers and search engines the move is final. Reserve 302 for genuinely temporary situations.

The order that keeps things to a single hop is: upgrade to HTTPS and switch the hostname in the same rule. A visitor arriving at http://example.in/page should land directly on https://www.example.in/page, not bounce through two intermediate addresses.

Two details are often missed. First, redirects must preserve the path and query string, so a shared link to a product page does not dump the visitor on the homepage. Second, the certificate must cover both forms. A certificate issued only for the www name will produce a browser warning when someone tries the bare domain, and the warning appears before your redirect ever runs.

Where to configure the redirect

In the web server

Apache or Nginx rules are the most reliable place, because they run before your application. Keep the rule in one file and comment it, so nobody adds a second conflicting rule later.

In the application

Most CMS platforms have a site address setting that redirects mismatched requests. This is convenient, but it means every wrong request boots up the whole application first.

In the CDN or proxy

If you use a service such as Cloudflare in front of the site, redirects can happen at the edge, which is fast. The risk is duplication: an edge rule plus a server rule plus a CMS setting can create a loop where each layer sends the request to the other. When a browser reports too many redirects, look for exactly this.

In the hosting control panel

Many panels offer a “force HTTPS” or “preferred domain” toggle that writes the rule for you. Fine to use, as long as you know it is there when debugging later.

HTTPS settings that finish the job

  1. Issue a certificate covering both names. A free Let's Encrypt certificate can list the bare domain and www together.
  2. Fix mixed content. Images, scripts and stylesheets loaded over http on an https page will be blocked or downgrade the padlock. Search your database and templates for hard-coded http links.
  3. Update the CMS site URL to the https preferred form, otherwise the application will keep generating links to the old address.
  4. Consider HSTS once everything is stable. It tells browsers to use HTTPS automatically, but it is difficult to undo, so enable it with a short duration first.
  5. Handle subdomains separately. A staging or help subdomain needs its own certificate and its own redirect decision.

How to verify your domain setup

  • Test all four combinations by hand in a private browsing window and confirm each ends at the preferred address with a padlock.
  • Check a deep page, not just the homepage, and one with a query string.
  • Use a redirect checker or browser developer tools to confirm a 301 and a single hop.
  • In Google Search Console, add both www and non-www properties, or a domain property, so you can see if the wrong version is being indexed.
  • Re-test after any hosting move, CDN change or certificate renewal, since these commonly reset redirect rules.

Lock the configuration in before your next change

Spend twenty minutes today testing all four variants and noting your preferred domain in your site documentation alongside the registrar and DNS details. Anyone who later moves the site will need it. If you are registering a new domain or consolidating several, our team can set the preferred address and certificate up correctly from day one as part of domain registration.

Frequently asked questions

Will switching from www to non-www hurt my rankings?

Done properly with 301 redirects, the effect is usually small and temporary. Still, only switch if there is a real reason, and update your sitemap and Search Console properties at the same time.

Should I redirect www to non-www or the other way round?

Either, as long as one redirects to the other and you use the winner consistently everywhere, including printed material and email signatures.

Why does my site say too many redirects?

Usually two layers are redirecting to each other, for example a CDN sending traffic to https while the server sends it back to http. Disable one layer's rule and test again.

Do I need separate certificates for www and non-www?

No. One certificate can cover both names, and most free and paid certificates do this by default. Just confirm both are listed before assuming it works.

Thinking about a website?

See what a package covers and what it costs, or ask us about your own project.

Thinking…