Navigate HTTP Status Codes Like a Pro
Understand HTTP status codes inside out—download our free guide to fix issues and keep your website running smoothly.
Google reCAPTCHA used. Privacy Policy and Terms of Service apply
Surely, you have tried accessing a specific web page only to stumble upon a 404 error message. The Error code 404 is an HTTP Status Code that indicates that the page you are trying to visit is not present on the web server. Seeing this code as a website visitor, you will most likely close the tab and find what you are looking for elsewhere. Still, there are a few things you can do to try and resolve the issue on your end.
If you are the website owner, however, you should take prompt action to solve it. For example, there may be a page for which you changed the URL and forgot to redirect it, or a missing asset on your site causing the error. Due to that, your visitors would see a 404 error code when they try to open a product or a specific web page on your website. Fixing it will help you prevent losing traffic or SEO ranking.
In this article, we will examine what error 404 is, what causes it, its SEO impact, and how you can fix it. We will also show you how you can create a custom 404 page to help keep your visitors engaged.
Navigate HTTP Status Codes Like a Pro
Understand HTTP status codes inside out—download our free guide to fix issues and keep your website running smoothly.
Google reCAPTCHA used. Privacy Policy and Terms of Service apply
In simple terms, this definition states that the resource you are looking for is either not present on the server, or there is a 301 redirect, routing 404 pages to existing ones.
When you are reaching a web page on the network, you are practically requesting the server that hosts this website. Generally, the server will respond with the content you are requesting. However, if the server is unable to find what you are looking for, it will respond with an error 404 Not Found.
Many site owners prefer to create their own 404 page where they advise visitors to use the search function on the website, check a relevant page, or go back to the home page. This way, it is more likely for a customer to repeat the search or find similar answers within the same site.
In any case, the server responds with a 404 status code not only for a missing page but virtually for any absent asset on a site – an image file or CSS/JavaScript files.
You may encounter the error page 404 presented in various designs and wording depending on your browser or the website you want to visit, although it points to the same underlying issue.
The most common variations for a 404 error are listed below:
The standard error page is pretty straightforward and simple in design, as shown in the screenshot below:
However, reputable online businesses like eBay, strive to keep their audience even if they cannot provide exactly what was needed.
At SiteGround, if you don’t have a custom 404 page for your website, our 404-Not Found page will show up.
Let’s say that you are looking for a particular product or post on a site and stumbling on an error 404 instead of getting what you need. As a visitor, you can try a few things on your end to see if that will fix the error.
Provided that you manage a WordPress site and the 404 Not Found is preventing access to it, there are several weak spots you can focus on. You can generally fix site-wide 404 errors, by following the steps outlined below.
The easiest way to regenerate the .htaccess file for your WordPress website is to use the Permalink page in your Dashboard, as long as you have access to it. After you log into your WordPress Dashboard, navigate to General > Permalinks from the sidebar and simply hit the Save changes button (without actually making any changes).
This action will regenerate your .htaccess, and if this is the culprit, the error 404 should be resolved after a refresh.
In case your Dashboard is inaccessible, you can manually regenerate the .htaccess using your File Manager.
To do that, navigate to the respective Site Tools for your website and go for Site > File Manager. Locate the .htaccess file in the website’s public_html folder and click twice to open it for editing.
Once you have opened your file, replace its content with the code below and Save the changes:
# 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
Try reloading the page afterward and see if the error 404 is gone, if not – keep reading to learn what else you can do.
Quite often, when custom URL settings are enabled, new rules are added to your .htaccess. If your configuration is not properly done, the new rules can break the .htaccess file, and that results in 404 errors.
If you have recently enabled search engine-friendly URLs (SEF) in your application and you started seeing 404 errors shortly after that, you may need to revise your setup. To do that, go to the Permalinks page in your WordPress Dashboard. When in there, select from several predefined options or set a custom structure for your links.
Alternatively, make sure that your .htaccess file in your WordPress’s main directory has the following rules:
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Your site may return a 404 error if you’re trying to reach a file that is not at the address you’re opening. Usually, all files that are supposed to be openable and downloadable are placed within the public_html folder of your site.
To make sure that the file you’re trying to reach is actually in its right place, review the content of the public_html folder. You can do this in your File Manager at Site Tools > Site > File Manager. For WordPress sites, the image files are usually stored in the wp-content/uploads folder.
If you find out that the file you’re trying to reach is not in the public_html folder, you can simply upload it. You can do that by using the Upload icon in the File Manager or just drag and drop the file into it.
Furthermore, if you have deleted a post or a page recently, you should set up a 301 Redirect for it to another page with relevant content. The same applies to posts for which you changed the URL slug – you should set a redirect from the old URL to the new one. In that manner, you will keep your audience engaged with your content and reduce the bounce rate.
As a last resort, you may try fixing the WordPress errors by restoring your site from a backup. This may help you recover any missing assets or content from your site. Thus, if that is the culprit, a backup restore could resolve the 404 error you are struggling with.
In general, a 404 Error happens when several possible scenarios are at hand:
Let’s take a more detailed look at the causes:
Imagine that you created a post once; however, later on, you decided to change the URL slug to get a better SEO score. Yet, you forgot to redirect the old URL to the new one. Thus, when visitors search for the page with its previous name, they will be served an error page 404. The same happens when you have deleted a page or a post you do not want/need on your website anymore.
It is also common to simply type the wrong URL in the browser. If that is the case, the web server will respond with a 404 error message for the requested page. Another possibility is that the page was not linked correctly or the URL was designed with typos. Therefore, make sure to double-check the URL you are trying to use to rule out a typo.
At times, due to an outdated browser cache, you may see a 404 response code while the actual page is accessible on other devices.
If an image, CSS, or JavaScript file is missing, the browser will also throw a 404 status code for it, as it can not locate it on the web server.
In case you have just recently moved your site to another hosting provider, you’ve most likely pointed the domain’s DNS records to the new server. When that happens, the domain name goes into the so-called propagation period, which may take up to 72 hours. During that time, all sorts of errors may come up on your website (including an error 404) until the DNS changes settle globally.
For example, you may search for a page; however, the browser is still looking for it on the old server. On that occasion, the server will respond with a 404 error as it can not locate the resource.
Search Engines like Google, Bing, and Yandex use sophisticated algorithms to monitor website visitors’ behavior. How a user interacts with your site affects a large part of your SEO ranking.
If a visitor comes to your website only to be faced with a 404 Page Not Found Error, they will most likely close the tab or click the Go Back button in the browser. This means that the user spent a short time and no cash on your site, as the search result does not match the user’s intent.
Google will consider it a negative user experience and account for it in your overall bounce rate. The bounce rate is one of the most important factors in building an SEO-friendly website. For instance, if your site generates a high bounce rate, Google will show your page lower in the Search Engine Results Pages (SERPs).
To avoid the negative effects of the 404 error, you should regularly inspect your site for broken links. It is highly important to either correct them or redirect them to other relevant pages.
It is highly important to detect any broken links on your website and attend to them. For instance, if you delete a post, it is best to set up a redirect toward another relevant page to retain the traffic within your website. This way, you may keep the SEO benefits of the link juice from quality backlinks (incoming links) to the post you deleted.
However, if there is no other relevant page to redirect the deleted one to, you may keep it as it is and strip all internal links pointing to it.
In case there are outgoing links from your site responding with a 404 error message, you should revise and correct them. By fixing such outgoing links you will improve your site’s crawl budget, preventing the search engine from crawling non-existing pages.
There are many web tools you can use for broken link detection. They offer flexible functionalities which we will outline below:
More often than not, if you request a source, expecting certain content, and get an error 404 instead, you search for it elsewhere. Similarly, your visitors may feel discouraged from interacting with your site if they are not finding what they need. Therefore, creating a custom 404 Not Found Page is a good strategy to mitigate the damage done by missing resources on your site.
Additionally, we also advise you to customize the page, including your site’s search functionality, a link to your home page, or even links relevant to the initial search content. You should also ensure your personalized 404 Not Found page matches your site’s design. That approach would help reap some potential of a missing asset and provide flexibility to your visitors.
Moreover, taking the time to create your own 404 page will keep the interest of your audience. This way, you can prevent negative impressions.
With most Content Management Systems (CMS)’ like WordPress, Joomla, and Drupal, there is a 404.html page included in their default themes. Some paid themes like Divi incorporate 404 page templates that you may customize to your preferences.
If your site is based on a custom code or your application does not encompass such a page, you can create one manually. To do that, simply go to the root directory of your site files and create a 404.php file, where you can place your code. To force the webserver to display the contents of your custom 404.php file, paste the following in your .htaccess file and save the changes:
ErrorDocument 404 /index.php?error=404
If you wonder how to create a custom WordPress 404 error page without coding skills or a theme that includes such a template, you should use a plugin for this.
Aside from the custom 404 error page layout, you may also input creativity in the error’s wording. This can turn around dissatisfied clients and keep them longer on your site, improving your bounce rate.
The 404 Not Found Error means that some content is missing. Another reason could be that there are configuration issues on the website. Unattended for too long, this type of error may harm your SEO score and impact your business. Thus, it is worth trying to fix a 404 using the tips in this article.
In terms of prevention, it’s good to frequently inspect your site for broken links and correct or redirect them if such are reported. Also, creating a custom 404 error page for your site could potentially keep your visitors browsing.
Become an expert in tackling all types of HTTP errors! Download our Guide on How to Fix the Most Common HTTP errors!