A 404 error is a common HTTP response code indicating that the requested resource could not be found on the server. This error occurs when a client (such as a web browser) requests a page or file that doesn’t exist on the server.
404 errors can occur for several reasons, including mistyping the URL, a broken link, a deleted page, a corrupt .htaccess file, incorrect file permission or a server error. It is important for website owners to fix any 404 errors they come across, as this can negatively impact user experience and search engine rankings.
Follow the steps below to resolve this error
1. Make Sure the Domain Points Correctly to your hosting
If the domain is still propagating, you can come across a 404 error page. To solve it, you will need to wait until the propagation is complete, this takes 24 hours to get completed.
The 404 error can also be caused by misconfigured DNS settings. You may have pointed the domain to an incorrect nameserver or IP address. Therefore, you need to check if the domain is pointed correctly. To solve this issue, use online tools such as DNS Checker, whatsmydns.net, etc to check which DNS server your domain is pointed to,
2. Update Your WordPress Site’s Permalinks
The issue might be with your permalinks or your .htaccess file. The best way to fix this is to update your permalink settings through the WordPress dashboard.
- Log into your WordPress dashboard
- Go to Settings → Permalinks
- Click Save Changes (you don’t need to make any changes before saving changes )
3. Set Up 301 Redirects For Moved or Renamed Content
When a user tries to access the content at an old location and sees a 404 page. To fix this error, an automatic redirection has to be done, a redirect that will redirect anyone who visits the old location to the new location, which is also good for SEO purposes. You can lose all the domain authority for a post that was renamed without redirection. You can use a free redirection plugin or use .htaccess to set up redirects, follow the steps in the link below to redirect your site. Forwarding a Domain Name
4. Disable the .htaccess File
As a crucial part of a website, .htaccess can become corrupt for several reasons, such as incompatible plugins and wrong configuration. A broken .htaccess may disrupt a website’s appearance and cause a 404 error page. To fix this problem, disable and create a new one.
Follow these steps to disable the .htaccess file :
- Log in to cPanel, and click on File Manager.
- Click the public_html folder
- Right-click on .htaccess and choose Rename.
- Add any character to the file name to disable the file.
- Click Rename to save the changes.
Then proceed to create a new .htaccess:
- In File Manager, click on New File in the upper menu.
- Type .htaccess as the file name.
- Copy and paste the code below:
# BEGIN WordPress RewriteEngine On RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress
- Click Create to save your changes.
If you can access the website after disabling and creating a new .htaccess file,
Then it means the 404 page not found error was caused by a corrupt .htaccess file.
5. Fix File Permissions
If error 404 still persists, we recommend fixing file permissions.
File and folder permissions let the server know who can run, read, or edit the data on the hosting account. However, if the values are incorrect, the web page may show a 404 error.
Therefore, you will need to modify the file permissions to solve this issue. The default values for files are 644 and for folders are 755.
Follow these to fix file permissions on cPanel:
- Log in to your Zalvis account.
- Select the hosting plan and click Manage.
- go to the File Manager
- Right-click on the file or folder you want to modify and select Permissions.
- Tick the boxes to modify accesses. The values will automatically update upon choosing the permissions.
- Click Change to apply the changes.
This should solve the 404 page not found error if the error came from incorrect permission.
6. Restore Backup
If all these solutions do not work, you can restore the backup from your cPanel, follow the steps in this link to restore a backup
If the above steps don’t resolve the issue, contact support for assistance.