Skip to main content

How to Troubleshoot a Domain That Works Without "www" but Not With It

This article helps you resolve issues where a website loads correctly when accessed via the root domain (e.g., example.com) but fails to load or displays an error when accessed with the www prefix (e.g., www.example.com). This issue typically affects...

This article helps you resolve issues where a website loads correctly when accessed via the root domain (e.g., example.com) but fails to load or displays an error when accessed with the www prefix (e.g., www.example.com). This issue typically affects customers using a standard website hosted on a Hostek account.

Before you begin

You will need:

  • Access to your domain's DNS records.

  • Access to your website's configuration settings (such as your web server's configuration file or a CMS plugin).

Check your DNS records

The most common cause of this issue is a missing or incorrect CNAME or A record for the www subdomain.

  1. Log in to your DNS management tool (such as your domain registrar's portal or a third party company like Cloudflare).

  2. Locate the DNS records for your domain.

  3. Look for a record with the Name or Host as www.

  4. Verify the record type and value:

    • If it is an A record, ensure it points to the correct IP address of your Hostek server.

    • If it is a CNAME record, ensure it points to your root domain (e.g., www points to example.com).

  5. If the www record is missing, create a CNAME record:

    • Type: CNAME

    • Name: www

    • Value: example.com (Replace example.com with your actual domain).

Check for a missing redirect

If the DNS records are correct but the site still fails to load with www, the web server may not be configured to handle the www request.

  1. Determine if your website uses a CMS like WordPress.

  2. If using WordPress, check your site's "Home" and "Site Address" settings in the dashboard.

  3. Ensure both fields are identical (e.g., both should be https://example.com or both should be https://www.example.com).

  4. If you prefer one version, use a redirection plugin or a .htaccess rule to force all traffic to your preferred version.

Check for SSL certificate mismatches

If the site loads but shows a "Not Secure" warning or a certificate error only when using www, your SSL certificate may not cover both versions of the domain.

  1. Verify that your SSL certificate includes both the root domain and the www subdomain.

  2. Check this by clicking the padlock icon in your browser and viewing the certificate details.

  3. If the certificate only lists example.com, you must update your certificate or your configuration to include the www subdomain.

Confirm the result

To verify the fix, perform the following tests:

  • Open a private or "Incognito" browser window.

  • Type the address with the www prefix (e.g., https://www.example.com) and press Enter.

  • The site should load successfully without any "Not Found" or "Connection Timed Out" errors.

  • Repeat the test with the root domain (e.g., https://example.com) to ensure it still functions correctly.

Limitations

  • DNS Propagation: Changes made to DNS records can take several hours to propagate globally. If the site does not work immediately after a change, wait at least 60 minutes before testing again.

  • Browser Cache: Your browser may cache the "failed" state of the www URL. Always use an Incognito window or clear your browser cache when testing DNS changes.

  • Cloudflare Users: If you use Cloudflare, ensure that the "Proxy" status (orange cloud) is enabled for the www record and that your Cloudflare "Page Rules" or "Redirect Rules" are not conflicting with the www prefix.

Did this answer your question?