Using 301 Redirects To Fix 404 Page Not Found Errors

Once you have found all of your site's not found errors using SpringTrax, the next question is, naturally, how do I fix those 404 errors?

SpringTrax Recommendations

With SpringTrax, we give you detailed steps to help you fix your website's not found error pages. For instance, you might find we recommend redirecting a broken link to a non-broken link on your site.

SpringTrax Redirect Recommendations
SpringTrax's recommendations tell you which redirects to implement to fix 404 errors on your site.

Adding in the redirect means that anybody who attempts to reach that 404 error URL (in the screenshot above, "/login" is a broken link), will instead be taken to a working page on your site (in the screenshot above, /login.html). As a result, nobody will be able to reach that same 404 error again.

There are recommended steps we will take, but we'll tackle those in separate blog posts. For now, let's talk about the redirect as a way to fix 404 errors.

404 Error Fixes: Adding A Redirect

You can think of a redirect like the online version of mail forwarding. If you move, you tell the post office to forward mail arriving at your old address to your new address instead. In the case of a redirect, you are telling your server to forward (or redirect) any requests made of a broken URL to a working URL instead. The way you tell your server to do this is by adjusting code on your server.

Using the recommended redirect in the screenshot above, we need to redirect /login (the 404 error page) to /login.html (a working page on that website). There are many different ways to do this, and you should work with your web development team to find the right way to make this work on your server. Two of the more common ways of implementing a redirect are through an htaccess file and through a web.config file. Let's take each of those one-by-one to see how exactly they work.

.htaccess Redirect

An .htaccess file is a control file for Apache servers. (You can find out what kind of server you are on by using a tool like This file is located in the main directory (or root directory) of your website. In this file, you can put a number of statements telling the server what to do.

  1. To create the statement in the .htaccess file, you want to first state that you are making a redirect with the statement redirect.
  2. Next, you want to define the type of redirect. In this case, we want to permanently fix the broken link, so the redirect type is 301 (which is a server-code for "Moved Permanently").
  3. Then you want to state the broken URL we want to redirect somewhere else. In our case, we are fixing the broken link of "/login". So, we'll want to state /login. Note that, this broken link shouldn't include your website's domain (so, no "").
  4. Finally, you want to state what URL to redirect to. In our case, this is "/login.html", which is the working page on this website. We'll state this by adding For this URL, we do want to include the domain name (so, do include "").

That is it! Putting it all together, you would have a line in your .htaccess file that looks something like this:

redirect 301 /login

After saving your .htaccess file to your server, the next time you visit, you will be redirected to

web.config Redirect

If you don't have an Apache server, adding in the redirect via an .htaccess file won't work. Another common method is adding in a redirect via a web.config file. Like the .htaccess file, a web.config is located in the main directory (or root directory) of your website. Also like an .htaccess file, you add a statement telling the server to redirect a certain URL. The redirect instructions go in between the <configuration> </configuration> tags.

  1. To create the statement in the web.config file, you will start by defining the path of the file you want to redirect (the broken link). For this example, we'll use the second recommendation in the screenshot above: With the broken link "calendar/634.html", we want to state our redirect path as: <location path="calendar/634.html"> Note that we don't inlcude (our domain) in this path definition.
  2. Next, we want to define our destination, which is where we want the broken link to redirect to. In our case, we want to redirect the broken link to This instruction is contained within an attribute of the httpRedirect tag. The attribute name is destination and the value is the full URL (including the domain we want to redirect to. That statement looks something like <httpRedirect enabled="true" destination="" />
  3. In the httpRedirect tag, we also want to add an attribute httpResponseStatus and set that attribute to "Permanent". This indicates that this is a permanent solution to the broken link. The full httpRedirect tag statement looks like <httpRedirect enabled="true" destination="" httpResponseStatus="Permanent" />
  4. Finally, we want to contain the httpRedirect tag within a <system.webServer> tag. The <system.webServer> tag ends up contained within the <location path="calendar/634.html"> tag we defined in step 1.

Putting all of that together, we end up with a full statement that looks like this:

<location path="calendar/634.html">
      <httpRedirect enabled="true" destination="" httpResponseStatus="Permanent" />

After adding this to the web.config file, going to will redirect us to

Need Help?

If you need help adding redirects to your website, just send us an email. We're happy to help you fix your website's 404 not found errors.

If you sign up for SpringTrax, we provide recommendations on how to fix your 404 errors, including what redirects to implement.


Share This Post

Add Comments

comments powered by Disqus

Are You Ready To Quit Losing Customers?

Contact Us Today To Find & Fix Every 404 Error On Your Website.

Learn About Our Services

We help you fix every error that affects your SEO and UX.