Subscribe Newsletter

Your Name  : 
Email Address *  : 
  • PNR Enquiry: Google SMS is a good way but besides it you can also check the PNR...
  • ???????: Thanks a lot, I have same problem and think how to solve it all day,...
  • Union Budget 2013-2014: Nice service by Indian Railways.
  • Railway Budget 2013: It is nice service of Google SMS by Indian Railway.
  • wordpress – widgets – plugin 2012: For more information see:...
  • PNR Status: thank you for the info
  • louisg: Thank you Bala Krishna, that’s very nice. Thanks for the SEO plug as...
  • Sandeep Beniwal: Hi, I want to convert video into .flv/.swf using asp.net...
  • Barun Roy Choudhury: Please send me swift code for IOB Santoshpur branch Kolkata...
  • Daniel: Hi, I followed the steps in the article and it gives me an error: Unknown...
  • amarana mohanarao: hello sir iam mohan plz send me STATEBANK OF INDIA [kotturu]...
  • Irina: Hi! Thank you for the article, really nice, but I have some more question...
  • s khaja mynuddin: hello i have forgotten my profile password can i send the filled...
  • Archives

  • Blog Stats

How to Permanently(301) Redirect 404 Error to WordPress Home

You might be occasionally come to an error page called 404 which is also known as Page Not Found. A 404 page is an error page which explain site visitors that the page they are looking for not found on the website.

If you are having many 404 error page on your website then you may want to redirect all of them to your Word Press home page.  It will remove all 404 links from search engine index and transfer all benefits those links have to home page. So, it’s a good idea to get SEO benefit from not exist pages. If you are having lots of 404 error pages showing in google webmaster tool then this is the most recommended thing you can do quickly to resolve the issue.

WordPress theme support 404 template which is automatically called when 404 error occurs.  All you need to create 404.php file with following content and then upload to current active theme directory. If you already have 404.php in theme folder then overwrite old file with new file or add following content on top of existing file.

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".get_bloginfo('url'));
exit();
?>

All you have done. Test it with a dummy 4o4 url to make sure code is working.

 


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

3 Responses to “How to Permanently(301) Redirect 404 Error to WordPress Home”

  1. Thanks Bala Krishna.
    good seo tips

  2. I’ve been using this code for quite sometimes in one of my blog. Works very well.

  3. Thank you Bala Krishna, that’s very nice. Thanks for the SEO plug as well, gotta update everything when I get a chance.
    Have a great weekend!

    louisg

Leave a Reply