Today we’re going to learn how to build a custom 404 page for your website or WordPress.
Create and design an html page as you would any other page and name it 404.html.
You can see your page by typing in
Now create for a file called
.htaccess. Note that sometimes they’re already in your files if you’re using WordPress for example.
.htaccess file put this:
ErrorDocument 404 /404.html. Note the space between the first 404 and /. If your index and 404 files aren’t in the same folder, it should look like
ErrorDocument 404 /folder/404.html.
You can test if it works by typing in random letters after your url such as,
yourdomain.com/abcd. Unfortunately it will not show up if you test it on your localhost.
Hopefully this has helped someone to become 1 step closer to becoming a better developer.