Learn how to fix 404 error pages

When you browse a web page and suddenly you see a big 404 number in front of you, it’s because the page doesn’t exists anymore.  It’s the thing all site owners hate to see on their website, which can mess up a user’s online experience.

Some search engines explicitly penalize websites that contain a lot of broken links.

A 404 error page could be generated because of:

  • URL change
  • Broken link

Before solving 404 error pages you first need to identify where they are and why. And Analyzati can help you FREE.

  1. The first thing you will need is to have a FREE account with us. Just register free here and continue to the next step
  2. Add your domain name in the Analyzati dashboard
  3. Get the code generated and paste it in your website. You need to add the code in your <head> or <body> section of your website.
  4. Now add the following code to your 404 page. Paste it between the <head> and </head> tags.

<script>
    window.addEventListener('DOMContentLoaded', function () {
        pa.track({name: '404'})
    });
</script>

From now on, and remember its FREE, you can track all 404 errors listed on your pages tab and on your events tab.

How to fix 404 errors ?

Once you have a list of URLs causing this error you can take action:

  1. If the error is because of a link, check if the link is pointing to a wrong url and fix the link
  2. If the error is because of a page that doesn’t exist you have two options: try to restore the page on the original link or create a 301 redirect to the new page url.

Creating a 301 redirect

A 301 redirect indicates the permanent moving of a web page from one location to another.

The most common method to create 301 redirects is using your .htaccess file located on your server.
For apache servers, you need to add the following line of code somewhere in your .htaccess:

Redirect 301 /old-page.html /new-page.html

If your website is running on WordPress, you can use a plugin like Redirection to create your 301 redirects. Is super easy and very handy.

Also you can create 301 redirects from cPanel. Just search for the menu Redirect and add/modify your redirects as needed.

Conclusion

As you have seen in this guide, Analyzati not only allows you to detect 404 errors, it also allows you to track what is happening on your website and understand visitors behaviour.

Check out by yourself FREE and start now!