Redirect your old files with a 301

January 20th, 2009


Assuming there is a change in structure/page names etc, an often overlooked aspect of re-developing an existing website is to add proper redirects to let users and search engines know where to find the new versions of already bookmarked/indexed pages. The chances are that when the old site has been upgraded, the content on those pages becomes out of date and incorrect fairly quickly, the old pages may also have been completely deleted or in the case of switching to a new hosting setup, have never existed. This means that the next time your users click on that bookmarked link, or when the search engines return to crawl your site again, the pages either return out of date information or even worse, inform both your users and the search engines that they don’t exist. Needless to say, this is not the result you are looking for from your new and lovingly crafted website.


Making sure your users and the search engines remain happy when they request one of your pages is actually very simple, all you need is a list of your old pages, a list of your new locations, a text editor and FTP access to your hosting. The solution is to use a “301 redirect”, this is an Apache specific method and wont work under IIS. (If you are running an IIS server, see the link at the bottom of this post for further details)


Here are the steps to take at the most basic level:

Create a new text (.txt) document and save it as .htaccess

To redirect a single file (or list of single files):

Redirect 301 /old-file.html

To redirect all of the old pages to your new website:

RedirectMatch 301 (.*)

Upload the .htaccess to your website’s root folder (where you’re index page is) and check that when requesting the old URL’s, you are redirected to the new URL’s


Apache  - Apache mod_alias documentation

Using IIS? - IIS 6.0 Server Administration Guide

Entry Filed under: server, web talk

Leave a Comment


Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


March 2019
« Feb    


Most Recent Posts