www vs non-www domain redirect and SSL guide

One of the most common questions website owners ask is: "Should I use www or non-www?" And often right after: "Does my SSL certificate cover both?" This guide covers every angle — technical differences, SEO impact, setting up redirects, and choosing the right SSL certificate.

1. What Are www and non-www?

www (World Wide Web) is a subdomain added before your domain name, like www.example.com. In the early days of the internet, www was standard practice to differentiate web services from FTP, mail, and other services.

Non-www (Apex Domain / Naked Domain) is the bare domain without any subdomain prefix, like example.com. It's also called the root domain, apex domain, or naked domain.

Key Point: Technically, www.example.com and example.com are different URLs. Without proper redirects, a server treats them as separate websites, causing duplicate content issues that harm SEO.

Technical Differences

Aspectwww (www.example.com)Non-www (example.com)
DNS Record TypeSupports CNAME (flexible)A Record only (points to IP)
CDN / Load BalancerBetter support via CNAMESome CDNs have limitations
Cookie ScopeIsolated from apex domainSent to all subdomains
URL Length4 extra charactersShorter, easier to remember
Brand PerceptionTraditionalClean and modern

2. www vs non-www SEO Comparison

Google has officially confirmed there is no SEO advantage between www and non-www. Both are treated equally for ranking purposes, provided canonical URLs are set correctly.

However, SEO problems arise when there's no redirect between the two versions:

SEO Summary: www and non-www are equal for SEO. The critical requirement is redirecting one version to the other and setting a clear canonical URL.

3. Which Should You Choose?

There's no universally right or wrong answer, but these factors help you decide:

Choose non-www if...

Choose www if...

⚠️ Warning: If your site already has significant traffic, think carefully before switching. While 301 redirects pass link equity, it can take 2-4 weeks for Google to fully reindex the new URLs.

4. Setting Up 301 Redirect in DirectAdmin

AsiaGB Hosting uses DirectAdmin as its control panel. Here are two ways to set up redirects:

Method 1: Via DirectAdmin Domain Setup

  1. Log in to your DirectAdmin panel
  2. Navigate to Domain Setup
  3. Click on your domain name
  4. In the Redirect section, select 301 and enter the target URL
  5. Save the settings

Method 2: Via SSL/HTTPS Settings

  1. In DirectAdmin, go to SSL Certificates
  2. Enable Force SSL or Force HTTPS
  3. Select whether to redirect to www or non-www
Recommended: Use the .htaccess method for maximum flexibility, especially when you need to combine HTTP→HTTPS and www→non-www redirects in a single rule.

5. Redirect via .htaccess

The most popular approach is editing the .htaccess file at your domain root via File Manager in DirectAdmin.

Redirect www to non-www (with Force HTTPS)

RewriteEngine On

# Force HTTPS + non-www
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^ https://example.com%{REQUEST_URI} [R=301,L]

Redirect non-www to www (with Force HTTPS)

RewriteEngine On

# Force HTTPS + www
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
⚠️ Important: Replace example.com with your actual domain. Always test the redirect before going live — a misconfigured rule can make your site inaccessible.

Testing Your Redirect with curl

# Test www redirect to non-www
curl -I http://www.example.com

# Expected output:
# HTTP/1.1 301 Moved Permanently
# Location: https://example.com/

6. SSL Certificate Coverage for www and non-www

A common issue is purchasing SSL and then seeing "Not Secure" warnings on some URLs because the certificate doesn't cover both versions.

SSL TypeCovers non-wwwCovers wwwNotes
Standard DV (Single Domain)✅ Yes✅ Usually includedMost CAs auto-include www
Let's Encrypt✅ Yes✅ Specify manuallyMust verify both domains
Wildcard SSL (*.example.com)❌ No✅ Yes (www is subdomain)*.example.com ≠ example.com
Wildcard + Root (SAN)✅ Yes✅ YesFull coverage, higher price
Multi-Domain (SAN)✅ Specify✅ SpecifyList each domain explicitly
Check Your SSL Coverage: Use AsiaGB's SSL Server Test or click the padlock in your browser → Certificate → Subject Alternative Names to see if both www and non-www are listed.

7. Wildcard SSL and www Support

Wildcard SSL like *.example.com covers all subdomains:

⚠️ Common Misconception: *.example.com does NOT cover example.com. If your site redirects to non-www but uses only a Wildcard SSL, visitors will see an SSL error on the non-www URL.

SSL Pricing at AsiaGB (Reference)

SSL TypeCovers www + non-wwwPrice/Year
RapidSSL (DV) — includes www✅ Both1,000 THB
GeoTrust QuickSSL Premium✅ Both3,000 THB
RapidSSL Wildcard (*.domain + root)✅ Both + all subdomains5,000 THB

8. Updating Google Search Console

After changing your URL preference, you need to inform Google:

Steps to Update Search Console

  1. Go to Google Search Console (search.google.com/search-console)
  2. Add a new Property for your chosen URL format (e.g., https://example.com/)
  3. Verify ownership via DNS, HTML file, or Google Analytics
  4. Go to Sitemaps and submit your sitemap.xml
  5. Wait 1-2 weeks for Google to reindex the new URLs

💡 What to Update After Changing URL Preference

  • 🔹 sitemap.xml — update all URLs to match your canonical choice
  • 🔹 Canonical tags on every page (<link rel="canonical">)
  • 🔹 og:url in Open Graph tags
  • 🔹 JSON-LD @id and url fields
  • 🔹 Internal links in content
  • 🔹 Google Analytics — Property URL
  • 🔹 Important backlinks — notify webmasters if possible (301 handles it automatically)

9. Post-Migration Checklist

#TaskDone?
1www redirects to non-www via 301 (or vice versa)
2HTTP redirects to HTTPS via 301
3SSL covers both www and non-www
4Canonical tags updated on all pages
5sitemap.xml uses the chosen URL format
6Google Search Console property updated
7hreflang URLs updated (if multilingual)
8SSL Checker shows no errors

10. Frequently Asked Questions

Is www or non-www better for SEO?
Neither has an SEO advantage. Google treats both equally. The critical factor is consistency — redirect one version to the other and set a canonical URL to prevent duplicate content issues.
Does SSL cover both www and non-www?
It depends on the SSL type. Standard DV certificates usually include both. Wildcard SSL (*.example.com) covers www but NOT the root domain. For full coverage, use a SAN or Wildcard+Root certificate.
How do I set up a 301 redirect from www to non-www in DirectAdmin?
Edit your .htaccess file via DirectAdmin's File Manager and add RewriteRules to redirect www to non-www while simultaneously forcing HTTPS. This handles both redirects in a single server-side rule.
Will switching from www to non-www hurt my rankings?
A properly implemented 301 redirect passes link equity. Rankings may fluctuate briefly but typically recover within 1-4 weeks as Google reindexes the new canonical URLs.
What is a Wildcard SSL and does it cover www?
Wildcard SSL (*.example.com) covers all subdomains including www.example.com, but does NOT cover example.com (the root domain). For both, you need a Wildcard+Root or SAN certificate.
Do I need to update Google Search Console after changing www preference?
Yes. Add the new URL version as a Search Console property, verify ownership, and submit a fresh sitemap. This helps Google recognize the preferred domain faster.

Need SSL That Covers Both www and non-www?

AsiaGB offers a range of SSL certificates from basic DV to Wildcard. Easy setup via DirectAdmin, works with all modern browsers, 99% uptime guaranteed.

View All SSL Options