404’s are part of every website. When coding a one page site, you might not have the time to create a custom 404 page. In which case, you might as well redirect the 404 page to your site’s homepage. In this article, we will show you how to redirect 404 page to home page in WordPress.
All you have to do is open your 404.php file in your theme’s folder. If it doesn’t exist, then create a blank php file. Paste the following code in there:
header(“HTTP/1.1 301 Moved Permanently”);
That’s all. Now when a user hits a 404 page will be redirected to the homepage.
© 2017 APT COM Hosting. All rights reserved.