A custom 404 page come in handy when someone is searching for a page on your website that does not exist. Perhaps they typed in the name wrong, or the link was broken, or it’s even possible that you’ve renamed the page or taken it down.

Here’s the problem: what happens when someone requests a page on your site that does not exist? Well, they don’t arrive at the desired page and they are redirected to a 404 page (404 is an error code). Usually, the 404 page is generic as set up by the hosting service, but you can replace it.

I’m actually not going to talk about creating your own page today, but something very similar: redirecting to a page of your choice.

It turns out that by knowing a little behind the scenes code, you can make this happen quite easily.

A good resource for this type of information is www.htaccesstools.com, and that’s what I’m going to use today. Open up www.htaccesstools.com and on the right side under Htaccess Generators heading, select Error document.

That opens up a page where you can type in the desired redirect URL. Do so, fully qualified, now copy and paste the result and save the text as a .txt file, say 404error.txt for example.

Now, upload the file to the root of your domain, where you want to set up the 404 page redirection.

Before you do the next step, determine if you already have a file named .htaccess in your root directory. The root directory would be without any extra sub-directories, such as www.domain.com. If you already have an .htaccess file you can’t use the technique directly, although you could edit the .htaccess file.

Let’s assume you don’t have anything called .htaccess, and you have uploaded your new 404error.txt file. Rename the file as .htaccess with no other extension or prefix.

This .htaccess file tells where you want your 404 page error code to redirect when a requested page is not found.

Although it sounds a bit complicated, it’s really easy if you are the least bit familiar with uploading pages to your website hosting account.

While we didn’t actually create a new 404 page we did enable the request to be handled by redirecting the user to a valid URL of our choosing. This could be the root URL or any other URL you want.

Tags: , , , , ,

One Comment to “Custom 404 Page Made Easy”

  1. [...] Custom 404 Page Made Easy - Marketing at 830pm [...]

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>