Get the Official WPSaviour App Now!


How to Redirect your 404 page to the Home Page in WordPress

404’s are part of every website. A while previously we compiled a listing of some pretty cool WordPress 404 designs. When coding a one internet web page website, you will not have the time to create a custom-made 404 internet web page. Throughout which case, you might as correctly redirect the 404 internet web page to your website’s homepage. On this text, we’ll current you learn how to redirect 404 internet web page to dwelling internet web page in WordPress.

All it is necessary to do is open your 404.php file in your theme’s folder. If it doesn’t exist, then create a clear php file. Paste the following code in there:

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

That’s all. Now when a shopper hits a 404 internet web page shall be redirected to the homepage.

Observe: This should be utilized in very explicit cases. In most completely different cases (i.e blogs, portfolios and so forth), you will need to track your 404 pages and redirect them appropriately.

Download The WPSaviour App Now

Related posts
Beginner’s GuideBlogShowcase

7 Best Shopify Alternatives in 2020 (Cheaper and More Powerful)

Beginner’s GuideBest WordPress PluginsBlog

14 Best AI Chatbots Software for Your Website (Comparison)

Beginner’s GuideBlogTips

Magento vs WooCommerce – Which one is Better? (Comparison)

Beginner’s GuideBlogTips

12 Best Calculator Plugins for Your WordPress Site

Sign up for our Newsletter and
stay informed

Leave a Reply

Your email address will not be published.

Fear Of Missing Out?

Sign up with your email address to receive WordPress tips and updates
Terms and Conditions apply
Click Me