Technology

404 Management on Hosting and DNS: 301 Redirects, Soft 404s and Real Fixes

404 errors look harmless at first glance: a user hits an old URL, your server says “Not Found”, they go back to search results. But when you look at this from a hosting and DNS perspective, unmanaged 404s quietly waste crawl budget, confuse search engines, hide real bugs in your stack, and make migrations far riskier than they need to be. In many audits we run at dchost.com, a messy 404/redirect situation is one of the first issues we spot in server logs, especially after domain changes, HTTPS migrations or large content refactors. The good news: with a bit of structure, you can turn 404 management into a predictable, almost boring part of your operations. In this article we will walk through how 404s actually happen on hosting and DNS, the difference between real and soft 404 errors, how to fix broken links with clean 301 redirects, and how to avoid the subtle pitfalls that keep returning in SEO reports.

404, Soft 404 and DNS Errors: What’s Really Going On?

HTTP 404 vs DNS-Level Errors

First, a key distinction: a 404 error is an HTTP status code returned by your web server (Apache, Nginx, LiteSpeed, etc.). It means: “The domain resolved correctly, a web server answered, but this specific path does not exist here.”

By contrast, DNS-level errors like NXDOMAIN happen before any HTTP conversation starts. When a user sees “This site can’t be reached” or DNS_PROBE_FINISHED_NXDOMAIN, the browser couldn’t find a valid IP for the domain or subdomain. That’s a DNS problem, not a 404. If you need a refresher on this layer, our article on what DNS records are and how A, AAAA and CNAME work is a good background read.

What Is a Soft 404?

A soft 404 is not an official HTTP status, but a term used by search engines (especially Google Search Console) for pages that:

  • Return HTTP 200 OK (or sometimes a redirect), but
  • Contain content that clearly says something like “Page not found”, “This product is unavailable”, or otherwise has very little or no useful content.

From a browser’s point of view everything is fine: it got a 200 response. From a crawler’s point of view, this is misleading. The page looks like an error page pretending to be normal content, so it’s treated as a soft 404. These often appear when developers implement custom 404 pages but forget to set the proper status code, or when they remove many products/posts and leave thin stub pages behind.

Other Relevant Status Codes: 301, 302, 410 and 503

404 management is never just about 404. The broader picture includes:

  • 301 Moved Permanently: permanent redirect; tells browsers and search engines that a URL has a new canonical home.
  • 302 / 307 Temporary Redirect: short-term move; the old URL might be back later.
  • 410 Gone: the resource is deliberately and permanently removed with no replacement.
  • 503 Service Unavailable (with Retry-After): planned maintenance or temporary overload, not a 404.

For a deeper dive into how these codes impact indexing and performance, you can check our guide on what HTTP status codes mean for SEO and hosting. In this article we’ll focus on when and how to choose between 404, 301 and 410 in real infrastructure.

Common Real-World Causes of 404s on Hosting and DNS

1. URL Structure Changes and Content Refactors

One of the most common reasons we see for 404 growth is a big content restructure: changing a blog from /2024/02/post-name to /blog/post-name, moving a store from /shop/ to /store/, or renaming category slugs. From the CMS side it feels like “just updating permalinks”. From the outside world, thousands of old links from Google, social media, newsletters and partner sites suddenly break unless you put 301 redirects in place.

This is exactly the scenario where pattern-based redirect rules shine. We covered this in depth, with concrete .htaccess and Nginx examples, in our article on changing URL structure safely with 301 redirects. When you plan ahead, you can migrate entire sections without a spike in 404s or SEO loss.

2. HTTP to HTTPS and www / non-www Canonicals

Another classic source of redirects and 404s is the move from http:// to https://, or choosing a canonical hostname like www.example.com instead of example.com. If this is misconfigured, you can end up with loops (more on that later) or stray URLs that don’t redirect to the secure canonical version at all.

The correct approach is usually:

  • Choose a single canonical hostname (www or bare domain).
  • Serve HTTPS there as the primary version.
  • Use 301 redirects from all other variants (http → https, non-www → www or vice versa).

If you’re planning a full HTTPS move, we strongly recommend following a structured process like in our HTTP to HTTPS migration guide with HSTS and canonical settings. A clean HTTPS migration often reduces 404 chaos dramatically.

3. Domain, Subdomain and Brand Changes

When a brand changes its main domain, introduces language subdomains, or merges sites, it’s easy to create thousands of broken links if the migration is handled only at DNS level (changing nameservers or A records) without planning HTTP redirects.

Typical patterns include:

  • Moving from oldbrand.com to newbrand.com without 301s.
  • Turning blog.example.com into example.com/blog/.
  • Retiring old country domains and consolidating into a single global site.

DNS alone cannot send a browser to a new URL path; it only translates names to IPs. Without well-thought-out redirect rules on the web server, you will see a flood of 404s. If you’re planning to consolidate multiple domains, our article on pointing multiple domains to one website with 301 redirects and canonical settings is an excellent reference.

4. DNS Misconfigurations and Expired Domains

Sometimes the problem isn’t the web app at all; it’s DNS. We frequently see:

  • Domains pointing to the wrong server IP after a migration.
  • Subdomains left with stale A/AAAA records to servers that no longer host the site.
  • CNAME chains pointing to decommissioned hosts.
  • Domains that simply expired or were transferred without copying DNS records.

In these cases, users often see browser-level errors (NXDOMAIN, timeouts) instead of a clean 404 page. From an operations point of view, those are worse, because you have no chance to present a helpful error page or redirect. That’s why we emphasise DNS reviews in every migration and recommend using a checklist like in our hosting and DNS audit checklist for new clients.

5. Application-Level Edge Cases

Finally, some 404s come from application logic:

  • Dynamic routes that assume an ID or slug exists in the database.
  • Filters and pagination that generate invalid URLs when parameters are missing.
  • Search pages that show “no results” but still return HTTP 200 with almost no content, triggering soft 404s.

These are best fixed jointly by developers and ops: the app should explicitly return 404 or 410 when something is truly missing, and your web server should provide a solid fallback 404 page for any paths the app doesn’t recognise.

Why 404 Management Matters for SEO, UX and Infrastructure

Let’s be clear: some 404s are normal. Users mistype URLs, old links from third-party sites linger forever, bots crawl random paths. That’s fine. The problem is uncontrolled 404 growth and soft 404 patterns that signal deeper issues.

  • SEO impact: Search engines waste crawl budget on useless URLs, miss your important new pages, or drop them because signals are diluted between old and new URLs.
  • User experience: Broken links from your own menus, sitemaps or emails frustrate visitors and reduce conversions.
  • Monitoring noise: Real problems (like 500 errors) get buried under thousands of avoidable 404s in logs and dashboards.
  • Migration risk: Domain or URL changes become much riskier if you can’t predict how 404s and 301s will behave.

Our aim at dchost.com is not to chase zero 404s—that’s unrealistic—but to build a clean, intentional 404/301/410 strategy so that every missing URL has a clear reason and behaviour.

Finding 404 and Soft 404 Problems on Your Hosting

1. Reading Web Server Logs

On a VPS or dedicated server, your most honest source of truth is the access log. For example, on Apache you might see:

"GET /old-blog/post-123 HTTP/1.1" 404 512 "-" "Mozilla/5.0 ..."

The 404 in the status field is what you’re hunting for. You can quickly count top 404 URLs with tools like grep and awk, or more advanced log analysis stacks. If you want a refresher on reading log formats and diagnosing HTTP errors, see our article on how to read web server logs to find 4xx–5xx errors.

2. Google Search Console and Analytics

Google Search Console (GSC) is especially useful for soft 404s. In the Indexing reports, it explicitly lists URLs considered soft 404, based on both response codes and page content. If you see many URLs there, you likely have one of these issues:

  • Error pages returning 200 instead of 404.
  • Very thin category or product pages.
  • Redirect chains ending on empty or irrelevant pages.

Web analytics tools (GA4, Matomo, etc.) are also helpful: create a report filtered by page title contains "404" or by the 404 template URL. That shows which missing URLs actual users hit, not just bots.

3. Crawlers and Automated Checks

SEO crawlers (Screaming Frog, Sitebulb, etc.) simulate a search engine crawling your site and report 404s, redirect chains and soft 404-like patterns. These are great when you’re planning a migration: crawl the old site, export all URLs, then ensure each one has a defined destination (301, 404, or 410) on the new infrastructure.

4. During Migrations and Deployments

We advise treating 404 behaviour as an explicit checklist item for any big change: new theme, URL refactor, domain change, or platform migration. A simple but effective approach:

  1. List key URLs (home, categories, best-sellers, top blog posts, landing pages).
  2. Test them before and after cutover, following all redirects until the final destination.
  3. Record the final status code (should be 200, 301 or 302; never 404 for key pages).
  4. Watch logs for spikes in 404 shortly after deployment.

This is also where well-tuned DNS and TTL planning help; if you want to go deeper on that side, our article on TTL strategies for zero-downtime migrations is a good complement to this 404-focused view.

Fixing Broken Links with Smart 301 Redirects

When to Use 301 vs 410 vs Leaving a 404

Not every missing URL deserves a redirect. A simple rule of thumb:

  • Use 301 when there is a clear, permanent replacement that satisfies the same intent (e.g. a product moved to a new slug, a blog post relocated under a different category).
  • Use 410 when the content is deliberately removed and has no equivalent (e.g. a legal notice that no longer applies, a discontinued product line you don’t want indexed anymore).
  • Leave 404 when the URL was never real or is obviously garbage (bots probing random paths).

Abusing 301s (“everything 301s to the homepage”) is almost as bad as leaving everything broken. Search engines may treat such redirects as soft 404s if the target page is irrelevant.

Designing a Redirect Strategy

Before touching configuration files, map out your redirects:

  1. One-to-one redirects: Specific high-value URLs (top blog posts, landing pages, campaign URLs) should have precise 301 rules to their new equivalents.
  2. Pattern-based redirects: For large structural changes (e.g. /blog/old-slug/blog/new-slug with predictable patterns).
  3. Fallback behaviour: Define what to do when no redirect rule matches: usually a well-designed 404 page with helpful links.

For big refactors, we often combine both: pattern rules handle 95% of URLs, and a small manual mapping file covers the highly linked or unusual ones.

Implementing 301s on Apache (.htaccess)

On shared hosting or Apache-based VPS setups, .htaccess is a common place to configure redirects. A simple one-to-one rule:

Redirect 301 /old-page/ https://www.example.com/new-page/

Pattern-based with mod_rewrite might look like:

RewriteEngine On
# Move all posts from /old-blog/ to /blog/
RewriteRule ^old-blog/(.*)$ /blog/$1 [R=301,L]

Always test rules on a staging environment when possible, and make sure you don’t accidentally create loops (e.g. rule A sending to URL B, while rule B sends back to URL A).

Implementing 301s on Nginx

On Nginx, redirects are typically placed in the server block configuration. A basic example:

server {
    listen 80;
    server_name old.example.com;
    return 301 https://new.example.com$request_uri;
}

And a path-only rewrite:

location /old-blog/ {
    return 301 /blog/$request_uri;
}

Or, for a more flexible pattern:

location ~ ^/old-blog/(.*)$ {
    return 301 /blog/$1;
}

After updating Nginx, always nginx -t to test the configuration before reloading.

Redirects vs DNS: What Goes Where?

It’s important not to mix roles:

  • DNS maps domains/subdomains to IPs or other hostnames (via A/AAAA/CNAME). It cannot say “this URL moved to /new-page”.
  • HTTP redirects (301/302) happen in the web server or application. They know about paths and can implement complex logic.

If you want oldbrand.com/path to redirect to newbrand.com/new-path, DNS should point oldbrand.com to a web server that knows how to handle that redirect. Trying to “do redirects in DNS” with CNAMEs usually leads to confusion, and in many cases isn’t even allowed at the zone apex.

Avoiding Soft 404 Errors on Hosting and DNS

1. Make Sure Error Pages Return the Correct Status

The most common soft 404 pattern we see is a beautiful custom 404 page that still returns HTTP 200. From a design perspective it looks perfect; from SEO’s perspective, it’s a lie.

On Apache, you typically set:

ErrorDocument 404 /custom-404.html

Make sure your custom 404 file does not override the status. The web server should send 404, while the user sees your styled error page. On Nginx:

error_page 404 /custom-404.html;
location = /custom-404.html {
    internal;
}

In both cases, confirm with curl or your browser’s developer tools that the final response code is 404, not 200.

2. Don’t Turn Every Problem into a 200 OK

Some frameworks or themes try to be too “helpful”: if a product is missing, they show a generic “product not found” block on a normal template and still return 200. Or they display category pages with no products and almost no content. Google often flags these as soft 404s.

Better patterns include:

  • If the specific item truly does not exist anymore, return 404 or 410.
  • If possible, suggest related items or closest alternative pages and use 301 to those, provided the intent is really similar.
  • For empty categories, provide substantial, useful content explaining the situation and linking to relevant alternatives, or deindex them if they aren’t meant to be landing pages.

3. Handle Maintenance and Outages with 503, Not 404

During planned maintenance, some sites mistakenly serve 404 or 200 with a “Site under maintenance” message. Both are misleading for crawlers. The correct status is 503 Service Unavailable with a Retry-After header, which clearly tells search engines: “This is temporary, come back later.”

We’ve written a full guide on how to do this without hurting rankings or UX in our article on maintenance windows and downtime pages for SEO-safe outages. Following that playbook helps you avoid sudden waves of soft 404 and indexing issues after maintenance.

4. Avoid Long Redirect Chains and Loops

Soft 404s sometimes show up at the end of messy redirect chains. For example:

  1. /old-product → 301 → /product
  2. /product → 302 → /product?ref=abc
  3. /product?ref=abc → 301 → /shop/product

Even if the final URL returns 200, crawlers may treat this as low-quality or ambiguous, especially if the target content is thin. Best practices:

  • Ensure no more than one hop for the majority of redirects.
  • Update older rules so they point directly to the current canonical URL.
  • Periodically crawl your site to detect chains and loops and clean them up.

DNS and Multi-Domain Strategy for Clean 404 Management

1. Parked Domains and Canonical Targets

Many businesses own multiple domains: typos, legacy brand names, ccTLDs, and marketing domains. If these just show a blank parking page or redirect everything to the homepage, you’re missing an opportunity to control UX and SEO.

A better pattern is:

  • Point all auxiliary domains via DNS to a small web server configuration.
  • Implement 301 redirects at HTTP level to the main canonical site (preserving paths where relevant).
  • Use consistent canonical tags so search engines understand which domain is primary.

We go deeper into these decisions—including when to keep parked domains truly parked vs actively redirected—in our guide on how to manage parked domains without hurting SEO.

2. Cleaning Up Old Subdomains and Dangling DNS

Over the years, projects accumulate test subdomains, old microsites, staging environments and forgotten apps. From a DNS point of view, they may still exist and point to IPs that no longer serve valid content, resulting in strange 404s or worse, error pages from unrelated services.

We recommend a periodic inventory:

  • List all A, AAAA and CNAME records in your DNS zones.
  • Check each subdomain in a browser and via curl.
  • Either remove unused records or implement clean 301/302 or proper 404/410 responses on a controlled server.

This is not only good hygiene for 404 management; it’s also a security practice, reducing the chance of subdomain takeover on abandoned hostnames.

3. Sitemaps, robots.txt and 404 Hygiene

Your sitemap.xml and robots.txt are effectively public declarations of what you consider to be “real” URLs on your site. If the sitemap still lists URLs that now return 404 or soft 404, crawlers will keep hitting them.

After big migrations or cleanups, regenerate sitemaps to include only live, indexable URLs. Also ensure robots.txt does not accidentally block access to your 404 page or important redirect destinations. We cover these details more thoroughly in our guide on setting up robots.txt and sitemap.xml correctly for SEO and hosting.

What We Focus on at dchost.com (and How You Can Adopt the Same Habits)

From our perspective as a hosting provider, 404 management sits at the intersection of DNS, web server configuration and application logic. When we help customers with migrations or troubleshoot ranking drops, our approach usually follows this order:

  1. DNS sanity check: Confirm all relevant domains and subdomains point to the right IPs and that there are no obvious NXDOMAIN or misrouted traffic issues.
  2. Log-based 404 review: Analyse access logs for frequent 404s, group by URL patterns, and identify whether they come from external links, internal links or bots.
  3. Redirect mapping: For important or heavily linked URLs, define explicit 301s. For obviously junk URLs, keep a clean 404.
  4. Status code correctness: Ensure custom error pages really return 404, maintenance pages return 503, and content moves use 301.
  5. Soft 404 audit: Use GSC and crawlers to identify soft 404 patterns, then adjust templates, content and HTTP codes accordingly.

You can adopt the same flow regardless of where you host, but if you’re on our shared hosting, VPS, dedicated or colocation services, our team is used to working through these steps with real log data and your application stack. Clean 404 management is not about perfection; it’s about removing surprises from your infrastructure.

If you’re planning a domain change, HTTPS migration or a large content refactor and want to avoid a mess of broken links and soft 404 warnings, it’s worth treating 404 management as a first-class part of your project plan, not an afterthought. Map your URLs, design your redirects, fix your status codes, and let DNS, hosting and application work together. That way, search engines, users and your monitoring tools all see a consistent, predictable picture—and you can ship changes with confidence.

Frequently Asked Questions

A standard 404 is an HTTP status code returned by your web server that clearly says “this URL does not exist here”. The browser sees a 404 status and a 404 page. A soft 404, on the other hand, is when the server returns 200 OK (or sometimes a redirect), but the page content looks like an error or has almost no value—for example, a template that says “page not found” but still sends 200. Search engines treat these as low-quality or misleading pages and label them as soft 404 in tools like Google Search Console. The fix is to send the correct status code (404 or 410) or provide genuinely useful replacement content.

Use a 301 redirect when there is a clear, permanent replacement that serves the same user intent as the missing URL—for example, a product that moved to a new slug, a blog post moved to a new category, or a domain rebrand where content lives at a new address. A well-targeted 301 passes link equity and preserves user experience. Leave a plain 404 when the URL was never valid or is obviously junk (bot probes, typos) and there’s no suitable replacement. Overusing 301s to send everything to the homepage can backfire; search engines may treat those redirects as soft 404s if the targets are irrelevant.

Start with your web server access logs: filter for status code 404 and list the most requested missing URLs. This shows what real users and bots are hitting. Next, check Google Search Console’s Indexing reports to see which URLs are reported as soft 404, along with sample pages. You can also run an SEO crawler to simulate a search engine and find broken internal links and redirect chains. On shared hosting or a VPS, it’s worth scheduling periodic log reviews so new 404 patterns don’t go unnoticed, especially after URL changes, HTTPS migrations or domain moves.

DNS itself doesn’t generate 404s; it only maps domains and subdomains to IP addresses. If DNS is wrong, users usually see errors like NXDOMAIN or connection timeouts before HTTP is even attempted. However, misaligned DNS and hosting can indirectly create messy 404 patterns—for example, when a domain points to an old server that no longer knows about your current URLs, or when unused subdomains still resolve but only show generic error pages. The best practice is to periodically review DNS records, remove or redirect unused hostnames, and ensure that all active domains point to servers configured with correct 301/404/410 handling.

No, having some 404 pages is normal and not harmful by itself. Users mistype URLs, other sites link incorrectly, and outdated links will always exist. Search engines understand this. The problem arises when you have many avoidable 404s from your own navigation, sitemaps or migrations, or when error pages are misconfigured as soft 404s. Focus on cleaning up internal links, adding 301s for important moved content, and ensuring your custom 404 page sends the correct status code while helping users find alternatives. A small, controlled number of genuine 404s is perfectly acceptable and often healthier than overly aggressive redirects.