404 errors may seem harmless but they can affect your website negatively. You can instead turn the 404 page errors into opportunity and redirect the 404 traffic to your homepage.
In this article we are going to share two ways you can easily redirect your 404 traffic to the homepage.
Table of Contents
What is a 404 error?
The HTTP 404 error also known as the page not found error is a response code returned by a server when it is unable to find what you are looking for. A 404 not found error is one of the most common HTTP errors and while they don’t affect the SEO score of a website negatively it is best to leverage them to retain the visitors on your website by redirecting them to the homepage.
Redirect 404 to homepage
Below are two methods to redirect a 404 error page to the homepage.
Redirecting 404 to homepage using a plugin
You can easily redirect the 404 page to your homepage using the All 404 Redirect to Homepage plugin. With over 200,000 active installations you can gauge the popularity of this plugin for redirections. The plugin is completely free to use and uses 301 redirects to send the traffic to your homepage.
Below are steps to redirect your 404 page to the homepage using this plugin.
- Install and activate the All 404 Redirect to Homepage plugin.
- Visit Settings -> All 404 Redirect to Homepage from your admin dashboard.
- Under the Options tab, set the 404 Redirection Status to Enabled and enter your homepage url in Redirect all 404 pages to.
- Click on the Update Options button.
- Once done all the 404 error pages will now be redirected to your homepage.
Redirecting 404 using htaccess
- Using FTP client, navigate to the root folder of your WordPress server files.
- Locate the .htaccess file and open it.
- In your .htaccess file add the below line.
ErrorDocument 404 /
Here / is your homepage url. You can replace it with any other url you might want.
- Save your .htaccess file and restart the Apache server to apply the changes. You can restart the Apache server from your cPanel.
- All the 404 pages will now redirect to your homepage.
Conclusion
Having your 404 pages redirect to your homepage can help you retain customers who would have otherwise left your website. It can also help in passing on the backlink juice to your homepage.