Monday, 20 January 2014

How To Redirect 404 Page To Homepage

Redirection of 404 page to home page is necessary for search engine optimization and it also helps users to get homepage from error pages. In order to redirect error page to home page, a small snippet must be added to 404.php in your theme folder, if you don't find 404page then create 404.php and add the following snippet in it.

header("HTTP/1.1 301 Moved Permanently");
header("Location: ".get_bloginfo('url'));

No comments:

Post a comment