hi,

I have a problem with one of my domain names. I've recently changed my hosting provider. I set the new nameservers for the domain.
But still, if I type "http://www.domain.com" it displays a page on my current webspace and if I type "http://domain.com", it displays a 404 Error page on my old webspace. What should I do?

Thanks,
Tom

Dani AI

Generated

The symptom describes usually means the two hostnames are resolving to different places: either DNS still points one name at the old host, or the new webserver is not configured to answer for the bare domain so requests fall back to the old host. is correct to check DNS, and 's idea of a single canonical hostname (redirect) is the right cleanup step after the name resolution and vhost issues are fixed.

Quick checks to run from your workstation or an online DNS tool:

dig NS example.com +short
dig @8.8.8.8 example.com A +short
dig @8.8.8.8 www.example.com A +short
curl -I http://example.com
curl -I -H "Host: www.example.com" http://<server-ip>

If the two dig results return different IPs, update the zone on the authoritative nameservers so the apex and www point to the same host (apex A/ALIAS or an A record; www as CNAME or A). On the webserver, make sure the virtual host includes both names (Apache ServerName/ServerAlias or nginx server_name) and then add a permanent redirect to your preferred hostname to avoid duplicate-content and mixups. DNS TTLs and caching can delay visible changes; see Cloudflare on propagation and vendor docs for vhost configuration for details: How long does DNS take to update? and Apache name-based vhosts.

Recommended Answers

All 2 Replies

Set up your .htaccess file to permanently redirect to the www in the domain name.

Make sure an a record or cname is setup in your dns for www.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.