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 |
Read more posts by Christopher Carey
- Watch stuff melt, implode, or explode in a Microwave - November 12th, 2008
- Convert your JPEG into a Vector Graphic - November 12th, 2008
- Blist is like Filemaker on Web 2.0 - November 12th, 2008
- iGoogle and Apple's Dashboard equal Schmedley - November 11th, 2008
- Blist is like Filemaker on Web 2.0 - November 11th, 2008
Comments
4 Responses to “Wordpress 404 error, fix it with a redirect to your main page”
Got something to say?

















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.
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.
Perfect..just what I was looking for! works like a treat..A thouands Thanks!
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!