Hi every1,

I was wondering how you make it so when you type in a non-existent web address, it brings up a customized error page instead of the 404 DNS error.

Thanx

Dani AI

Generated

Short clarification first: a DNS failure (no such domain) and an HTTP 404 are different. If a domain truly doesn't resolve, no server can show a custom page. If the domain resolves to your host but the requested path is missing, you can and should serve a custom 404. is right that the fix is server-side — here are practical, low-friction steps.

Create a simple static 404 and tell the server to use it. On Apache (common for shared hosts) put this in your document root .htaccess:

ErrorDocument 404 /404.html

Place 404.html at the site root. For dynamic sites, make sure the response actually sends a 404 header. Example in PHP:

<?php
header("HTTP/1.1 404 Not Found");
include '404-template.php';
exit;
?>

Test the result from your machine with:

curl -I https://yourdomain.example/some-nonexistent-page

Look for HTTP/1.1 404 Not Found. If the server returns 200 OK while showing your message, that’s a soft 404 — searchable and misleading to crawlers. Fix by sending the proper 404 header.

If your host uses Nginx, the directive looks different (ask support or their control panel). For hosted builders like the one mentioned, check the control panel for a “custom error page” option or contact support; premium plans often expose it. If you cannot change server settings, you can still create a friendly “not found” page, but beware that redirects or pages that return 200 will harm SEO.

Quick checklist: (1) add ErrorDocument or server config, (2) ensure the page returns HTTP 404, (3) include useful links/search on the page, (4) test with curl or browser devtools.

Recommended Answers

All 3 Replies

do you know if you can do this with freewebs web hosting? I'm a premium user.

No, I'm sorry, I wouldn't have a clue. You'll have to ask them, I'm afraid.

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.