Wordpress 404 error, fix it with a redirect to your main page


If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

It happens to everyone, the Wordpress 404 error.  It usually happens to Wordpress users when blogs get moved or corrupted.  This little 404 file for Wordpress will use a 301 redirect that redirects your user to your main url.  No edits to the code are required simply unzip and drop into your theme’s directory.

302 Moved temporarily (redirect) 662 51.7 % 1.60 KB
404 Document Not Found 592 46.2 % 12.62 MB
206 Partial Content

Check it out

Read more posts by Christopher Carey

Comments

4 Responses to “Wordpress 404 error, fix it with a redirect to your main page”

  1. Sarah King on MyAvatars 0.2 June 4th, 2007 9:37 pm

    I’d be wary of this. It’s good to have the page handled nicely (which WordPress does) but Google’s Webmaster Tools won’t validate sites that don’t throw 404’s. This raises concerns, then, about what the search engine thinks of the sites and what penalties it may impose.

  2. wiseassoffice on MyAvatars 0.2 June 4th, 2007 9:56 pm

    There shouldn’t any issue with this as the 404 can be found, it just redirects to the main page. I run it through google site map and it looked good.

  3. Stuart Stirling on MyAvatars 0.2 August 14th, 2008 9:37 am

    Perfect..just what I was looking for! works like a treat..A thouands Thanks!

  4. Steve on MyAvatars 0.2 August 19th, 2008 11:12 pm

    This is great. I didn’t realize that each theme had its own 404.php file. Alternatively you could replace:

    “Location: “.get_bloginfo(’url’);

    with something else:

    “Location: “.$new404page;

    or even

    “Location:http://www.notmyblogurl.com”;

    Thanks again for posting this!

Got something to say?