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:
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.