Welcome

Vector of NileI am Nile Flores, a sassy web designer and developer - a webmistress. I live in Centralia, Illinois, which is about an hour from St. Louis. Blondish.net is where I can freely share my love of all things involving web design, graphic design, web developing, and even my experience as a blogger. Join me on my journey. I hope I do not disappoint.
Blondish.net Rss Follow Me On Twitter Follow Me On Facebook Contact Me

Do Not Forget Your 404 Page!

Written by Nile | Posted in Blogging | Posted on Date 20-06-2009 | Comments 4 Comments
Tags:

Share

A 404 error page, or for those not familiar with the term, the ‘Page not Found error’ is important to have with any website. At Blondish.net, there is an article that illustrates the importance of a custom 404 page in detail, but it is really simple.

1. You are keeping your visitor within the site and giving them an alternate way to find what they are looking for.
2. The search engines will not frown as much on your custom 404 page as you are being courteous to your user, and once again, giving them another way to find what they want on your site.

A lot of themes come with the 404.php file, but there are some that do not. In the case you are making your own theme, or if you have downloaded a freebie, then you can make your own.

1. You need to know where to get the code for the 404 page, which can easily be found in the WordPress Codex. In the case of this tutorial, it will be using the basic code.


<?php get_header(); ?>
<div id="content" class="narrowcolumn">
<h2 class="center">Error 404 - Not Found</h2>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

2. Sure, you have a 404 page that will say “Error 404 – Not Found”, but you really need your site to do something. Perhaps you should add articles that are popular or want your readers to see that may be missed. Or perhaps it was a click on an old internal link from an old blog entry, you should think about putting a search form. A search form will really help.


<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php include (TEMPLATEPATH . "/searchform.php"); ?>

3. Edit your message to something friendly. Sometimes “Error 404 – Not Found” might be a bit shocking and make your user think they did something wrong. You could direct them to the home page of the site or as already suggested, articles you want your visitors to read.

Here is an example that is used here at Blondish.net

Oopsie! Sorry for the inconvenience.

If you were looking for something on Blondish.net, and did not find it you can contact me or use the form below to search for it. Again, apologies!

The message is allowed to be used. Just change the site name. No credit back is needed.

4. Add your recent posts. This may entice your readers to stay on the site. It is also fresh content and easier than adding featured posts (and editing them from time to time.)


<h2>Recent Posts</h2>
<ul>
<?php query_posts('posts_per_page=5');
if (have_posts()) : while (have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>" title="Permalink for : <?php the_title(); ?>"<?php the_title(); ?></a>
<?php endwhile; endif; ?>
</ul>

5. Get the search engines to find the custom 404 page. In your .htaccess file, you need to put the code:

ErrorDocument 404 /index.php?error=404

In the case your installation is not on the root of your site, but instead a subfolder, you need to make sure the folder name is added before the index.php link for the .htaccess Error Document function.

Very easy, right?

Share and Enjoy:
  • Digg
  • del.icio.us
  • Ping.fm
  • RSS
  • StumbleUpon
  • FriendFeed
  • Google Bookmarks
  • Identi.ca
  • LinkedIn
  • MySpace
  • Reddit
  • Technorati
  • Twitter
  • Yahoo! Buzz
  • Facebook
  • Netvibes
  • NewsVine
  • Posterous
  • Socialogs
  • Sphinn
  • blogmarks
  • Blogosphere News
  • Slashdot
  • Suggest to Techmeme via Twitter
  • Mixx

Related posts:

  1. Why You Should Use a Custom 404 Page
  2. What Is The Best Way To Display Posts On Your Front Page For SEO?
  3. Basic HTML: Using The Anchor Tag For A Page Jump

About Nile Flores

Nile is 29 year old female from Southern Illinois. Nile is a mother of 1 son. She is also a web and graphic designer, who exclusively designs using WordPress. She is currently a student working for a Bachelors in Business. She also blogs at WPAddict.net and FamousBloggers.net

Connect with Nile at: Twitter | Facebook | LinkedIn

Nile has written 424 articles at Blondish.net.

Comments (4)

  • Nile Flores says:

    Blondish.net – New blog post: Do Not Forget Your 404 Page! http://bit.ly/11abFN

  • RT @tweetmeme Do Not Forget Your 404 Page! | blondish.net http://tinyurl.com/mx9llh

  • [...] to Rio de Janeiro BigCi&#116&#121&#76ife – Free good looking day to day bloging theme&#10&#10&#10Do Not Forget Your 404 Page! – blondish.net 06/20/2009 A 404 err&#111&#114&#32page, or for those not familiar [...]

  • Nile Flores says:

    RT @tweetmeme Do Not Forget Your 404 Page! | blondish.net http://tinyurl.com/mx9llh

  • Write a comment

    ss_blog_claim=0ecba4af6bb1a8dccd90dffa7f9ff743