Skip to content
Home » Earn Money Online » Tips and Tricks » How Do I Get Rid Of Google Error 404

How Do I Get Rid Of Google Error 404

If you are looking to fix 404 errors then this article is for you. Here we will share the easiest ways to get rid of Goggle Error 404.

If you had added your website to Google Webmaster then you can easily find the list of ‘404 Not Found‘ errors. Once you find the list of such pages, resolve the same to get rid of it. It is very important to solve such errors otherwise, it will hurt the SEO of your site. Check out the below image to know how to get the list of ‘404 Not Found‘ pages in Google Webmaster.

404 not found error Google Webmaster

404 not found error Google Webmaster

There are two ways to resolve these error. First, create a custom 404 error page on your site. Second, redirect all your ‘404 Not Found’ error to custom URL.

Both the ways are safe and easy to implement. In the first, a custom message will be shown to the visitor whereas, in the second method, the visitor will get redirected to the said URL.

Custom 404 Error Page

In this case, a custom page will be shown to your visitor when the requested page doesn’t exist on the server. Follow the below steps to create custom 404 page.

  1. Create 404 Error file
  2. Login to your Server. (You can access your server through any means like CPanel or Filezilla)
  3. Open .htaccess file
  4. Paste below line in yours .htaccess file

ErrorDocument 404 /404.php

OR

ErrorDocument 404 /404.html

Remember, here ‘404.php’ is the name of your custom file. Replace the same with your file name if it is different from it.

That’s it. Now, your all 404 error page will get redirected to this file and your visitor will get the custom message written in the 404.php file.

If you don’t have access to your server then, in that case, you can directly set the 404 error message in the .htaccess file itself. Simply paste the below line in yours .htaccess file. There is no need of creating the custom page in this case.

ErrorDocument 404 "<H1>Page not found</H1>"

This will show ‘Page Not Found’ error to the visitor when the requested page doesn’t exist on the server.

404 redirect to homepage .htaccess

In this method, the visitor will get redirected to your homepage when the requested page doesn’t exist on the server.

Here, instead of getting the custom message, the visitor will get redirected to homepage or custom URL.

Follow the below steps to set the 404 redirect in yours .htaccess file

  1. Login to your Server. (You can access your server through any means like CPanel or Filezilla)
  2. Open .htaccess file
  3. Paste below line in the file and click ‘Save’

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

That’s it. It will redirect your ‘404 Not Found’ error to the homepage.

Instead of editing the .htaccess file, you can also redirect the page using 404.php file available on your server. Just simply paste the below line in your 404.php file.

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.example.com");
exit();
?>

Remove all the content from the file and simply paste the above code in it. Do not forget to replace the ‘example.com’ with your domain name.

This 404 file is already available on your server. Simply check your theme files to locate this file.

That’s it. It will also redirect your all 404 error to the homepage or custom URL.

We applied the second method and check out our Google Webmaster in below image

404 Not Found Error on Goggle Webmaster

404 Not Found Error on Goggle Webmaster

Now, your turn. If you know any other way to redirect 404 error to your home page or custom URL then please do share with us. You can share your ways in the below comment box.

1 thought on “How Do I Get Rid Of Google Error 404”

Leave a Reply

Your email address will not be published. Required fields are marked *