Blog
technical banner

Imagine this scenario: there’s a page on your website that you’d like to get rid of. It’s a fairly popular page, with a few links directing people to it. What will happen when you remove that page? Where will the people looking for it go? If you do nothing, these users will see a 404 error. Most of us know by now that a 404 error means that we won’t be accessing the page we wanted to find, but what does it really mean?

Response codes like this one tell web browsers and search engines alike what happened when they tried to get to a certain URL. In this case, the page was not found. A bad situation for the user indeed!

From a search engine perspective, these response codes give clues as to whether or not it should direct traffic to the page. Our 404 response, for example, tells the search engine that the page cannot be found. A search engine that sends its users to pages that don’t exist soon won’t exist itself, so it’s in the search engine’s best interest not to rank pages that return 404 codes. However, as the page is supposed to exist, the search engine will send a crawler to check it from time to time.

For the sake of protecting our rankings and providing a great experience for our users, we want to ensure that no pages on our sites return a response of 404. There are two things we can do to prevent this.

Redirect the page

The most common method is to redirect the URL to either the new one (if the page still exists but the URL was changed) or a similar URL. What happens when we redirect a URL is we give directions to browsers and search engines, showing them the way to the URL we want them to visit. When we do this we also give them instructions via, you guessed it, a response code!

There are two different URL response codes we should worry about: 301, and 302. It’s important to know the difference, especially from an SEO perspective.

301

A 301 response code signals that the page has permanently moved to a new URL. Most redirects should be “301 redirects.” You’ll use these if you decide to change your website’s address, if a popular product in your online store is discontinued (you’ll want to redirect to its replacement, a similar product, or a category of products), and in many more situations. When using 301 redirects, search engines will update their links to point to the correct URL.

302

A 302 response code suggests that the page is temporarily unavailable, but will be back. This is how it works in theory, anyway. In practice, 302 redirects are often used incorrectly in place of 301 redirects. When used correctly, these temporary redirects can usually be found when a page or website is down for maintenance. Search engines will continue to check the URL. If they find that the redirect has been in place for a considerable time, they will treat it as a 301 redirect instead.

Kill the page

Although it’s rarely used, it should be noted that there is a way to tell search engines that a page is dead and not coming back. This is by giving it a 410 response code. While Google has said that they will check once in a while to see if the page has come back, your intent with a 410 response code is made clear.

As I stated, the 410 code isn’t used all that often. Generally, redirecting the browser or search engine to a similar page is preferable. After all, why wouldn’t you want the ability to show that traffic another page that they might be interested in? So go ahead and make the 301 redirect your tool of choice for preventing the dreaded 404 response.

Need help setting this up? Drop me a line on Linkedin!