Why Does My Custom Domain Redirect to the Wrong Website?
If your custom domain opens the wrong website, the cause may be an incorrect DNS record, an old hosting configuration, a redirect rule, cached DNS information, or a domain attached to the wrong project.
If you connected a custom domain and it opens the wrong website, do not immediately assume the website files are broken.
The domain may still be connected to an old hosting service, the DNS records may point somewhere unexpected, or the hosting platform may have the domain attached to the wrong project. There is another important possibility: the domain may be reaching the correct server but being redirected by a website or hosting configuration.
Quick Answer
If your custom domain opens the wrong website, check the exact URL in the browser, check the domain's DNS records, confirm the domain points to the intended hosting provider, check whether old DNS records still exist, check the domain mapping inside the hosting dashboard, check for HTTP or HTTPS redirects, check whether www and the root domain are configured differently, and test using a private browser window and another network.
The most important question is: is the domain reaching the wrong server, or is the correct server redirecting it to the wrong website? That distinction makes troubleshooting much easier.
First Determine What Wrong Website Means
There are two very different situations. Situation one: the domain reaches another server because the DNS configuration may point to an old hosting provider or another server. Situation two: the domain reaches the correct server but redirects because the DNS can be correct while the hosting platform, web server, or application sends a redirect to another domain. These require different fixes.
Check the Exact URL
Look at the browser address bar. Suppose you entered https://example.com but the browser changes to https://old-example.com. That is a redirect. If the browser stays at https://example.com but displays another company's or another project's website, the problem may be related to server or domain mapping configuration. This distinction is extremely useful.
Check DNS
Inspect the DNS configuration for the domain. Look for the records responsible for directing the hostname to your hosting environment. Depending on the hosting provider, this may involve different record types and values. Do not copy records from another website. Use the current DNS instructions provided by your hosting provider.
Look for Old Hosting Records
A domain may still contain records from a previous hosting setup. For example, you may have moved example.com from Hosting A to Hosting B. If the relevant DNS configuration still points to Hosting A, visitors can continue reaching the old environment. Check for outdated records before adding more records.
Check the Hosting Dashboard
Even if DNS is correct, the domain can sometimes be attached to the wrong project or deployment. Open your hosting dashboard and check the domain configuration. Confirm that the domain is attached to the intended project, the project contains the expected website, the correct deployment is active, and the hostname is configured correctly.
Check www Separately
These are separate hostnames: example.com and www.example.com. They can have different DNS records and different hosting configurations. If example.com shows your new website but www.example.com shows an old website, investigate the www configuration separately.
Check Redirect Rules
If the browser changes the URL, inspect redirect configuration. Possible sources include hosting platform redirects, web-server configuration, application code, framework configuration, domain forwarding, and HTTP-to-HTTPS configuration. Find which layer is issuing the redirect before changing it.
Check Your Application
Sometimes the hosting configuration is correct but the application itself redirects users. Search your application for redirect logic involving the old domain, a canonical domain, authentication, environment variables, or URL configuration. This is especially important if the application was migrated from another domain.
Test Without Browser Cache
Test the domain in a private or incognito window, another browser, or another device. If possible, test from another network. This helps determine whether you are seeing cached information rather than the current configuration.
Be Careful With DNS Changes
Do not repeatedly add and remove records until something works. That can make the configuration harder to understand. Instead, write down the hostname, the current DNS record, the expected destination, the actual destination, and the hosting project attached to the domain. Then compare them.
A Simple Diagnosis Tree
For a domain that opens an old website, check DNS, old hosting, domain mapping, and cached DNS information. For a domain that redirects to another domain, check redirect rules, application code, hosting configuration, and domain forwarding. For a root domain that works but www shows another site, check the www DNS record, www domain mapping, and redirect configuration. For a website that works in one place but not another, check DNS caching, browser caching, and network-specific DNS behavior.
What Not to Do
Do not delete all DNS records without understanding them, add random A or CNAME records from tutorials, change multiple hosting settings simultaneously, assume the application is broken before checking DNS, or assume DNS is broken when the browser is actually being redirected. The goal is to identify which layer is responsible.
FAQ
Why is my domain showing my old website?
The domain may still point to an old hosting environment, or the hosting platform may still have the domain attached to an older project.
Why does my domain redirect to another domain?
A redirect rule, domain forwarding configuration, hosting configuration, or application code may be sending visitors elsewhere.
Why does www show a different website?
www and the root domain can have separate DNS and hosting configuration. Check both hostnames.
Can DNS caching make my domain show the wrong website?
Yes. Cached DNS information can cause different users or networks to temporarily reach different destinations.
Should I delete all my DNS records?
No. Identify the records that control the affected hostname before making changes.
Ready to launch your website?
Deploy your website in minutes with Host Better. Free SSL, custom domains, and instant deployment included.
Start Hosting Now