Pages Menu
TwitterRssFacebook
Categories Menu

Posted by on Mar 1, 2013 in Wordpress Tutorials | 0 comments

Guidelines To Redirect 404.php Page To the HomePage

Guidelines To Redirect 404.php Page To the HomePage

As website owners know that content and coding are very important for SEO purpose. Especially, coding part, if there are errors in coding, then the evaluation of SEO is low. 404 is one of the important factor that we should pay attention to since if every page or most of pages that are in this situation, can devalue the SEO of your website; and ranking of keywords or websites is not high. If your websites are in WordPress, then you can follow the instructions below to fix it. You can complete the task both by doing manually, and using plugins.

This tutorial will give you specific details about how to redirect 404.php page to homepage. Follow the guidelines, you can fix by yourself.

Method 1:

Find 404.php file and paste the following code in the file. Note, do not include get_header() or wp_footer() or other things if you are editing the page.

1
2
3
4
5
6
7
8
9
<html>

<head>

<meta HTTP-EQUIV="REFRESH" content="0; url=<?php bloginfo('url'); ?>">

</head>

</html>

Method 2:

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

Note: You can also get this done by using plugins that supported from WordPress. They give some good options to customize the pages where you want to redirect to. Both methods above only apply for all pages. Check here: wordpress.org/plugins/404redirected to get the plugins. Following the guidelines in wordpress, you can get it done easily.

Post a Reply

Your email address will not be published. Required fields are marked *