≡
  • Home
    • About Us
    • Site Map
  • Resources
    • Resources for Website Design
    • HTML Document Structure
    • Genealogy Web Site Design
      • Planning a genealogy website?
      • Organize your genealogy website
      • Creating a New Website
      • Customizing Your Website
      • Publishing your Genealogy Website
      • Maintaining Your Genealogy Website
    • Publishing With FTP
    • RootsWeb WorldConnect Project
    • Validation Tools
    • Browser Web Developer Toolbar
    • Website Design and Search Engines
    • Saving and Using a Complete Web Page from the Internet
  • Articles
    • Snagit and Genealogy
    • Top 10 Genealogy Mistakes to Avoid
    • Quick Tips for Beginner and Amateur Web Designers
    • Tennessee Family Bible Records
  • Tutorials
    • Tutorials & Articles
    • Add Search Box
    • Converting a Theme Based Site to DWT
    • Converting a Table Based Layout
    • Create custom Error Pages
    • Create 301 Redirects
    • Creating a New Website
    • Creating a FrontPage Web
    • Create a Gradient Image
    • Creating Layered Backgrounds
    • Creating A Navigation Menu
    • Creating Website Navigation
    • Heading Tags - <h1> to <h6> tags
    • Server Side Includes
    • www versus non www
    • Using Bordered Backgrounds
  • Templates
    • Fixed Width Templates
    • Mobile Friendly Templates
    • Liquid Layout Templates
    • Christmas CSS Layout Templates
    • Instructions for Using Templates
  • Contact

301 redirect tutorial

With the start of the new year come thoughts of doing some cleaning up of your website. Some of your file names have spaces in them like my page my page name.html. A Windows system will have no trouble with the file name either on the server or on your own computer. A UNIX operating systems (which run most servers) will have problems with them, and interprets the space as a "%20" character and looks for a file named:  my%20page%20name.html.

You go through and rename those pages on your site but what if Google has already indexed your site? What if that page already has a nice page rank? By changing  the file names, you run the risk of losing traffic and leaving visitors to your site who follow a search engine link with the dreaded "Error 404 - File not found." Creating a 301 permanent redirect is the best way to go.

N. B. If your site is hosted on a free server like RootsWeb or your ISP space, you are probably NOT going to have access to your .htaccess file to follow these instructions.

IMPORTANT! - If you want to redirect a non www domain to a www domain, you will need to follow the Google Canonical problems - www versus non.www tutorial.

What is 301 redirect?

Google says:

If you need to change the URL of a page as it is shown in search engine results, we recommended that you use a server-side 301 redirect. This is the best way to ensure that users and search engines are directed to the correct page. The 301 status code means that a page has permanently moved to a new location.

301 redirects are particularly useful in the following circumstances:

  • You've moved your site to a new domain, and you want to make the transition as seamless as possible.
    Example: I created a new domain for all of my Expression Web Tutorials and created a 301 redirect from the old domain to the new domain.
  • People access your site through several different URLs. If, for example, your home page can be reached in multiple ways - for instance, http://example.com/ or http://www.example.com - it's a good idea to pick one of those URLs as your preferred (canonical) destination, and use 301 redirects to send traffic from the other URLs to your preferred URL. Detailed Tutorial www versus non.www

Create and Implement 301 redirect for a single page

A 301 redirect is implemented in your .htaccess file. If you already have an .htaccess file on your server, you will need to download the file in the root directory of where all your web pages are stored. If there is no .htaccess file there, you can create one with Notepad. If there are lines of code that are already a part of your .htacess file,  be very careful not to change any existing line or lines.

  1. Open Notepad or any plain text editor - do NOT use your word processor
  2. Save the file with the name .htaccess - note the dot in front and there is no file extension
  3. Type the following using a separate one for each page you are redirecting
    Redirect 301 "/directory/old file name.html" http://www.your-domain.com/directory/new-file-name.html making sure your are using your files names, directory name and domain name. N.B. Note the use of the quotes at the beginning and end of the old file. Mine did not work until I added these.
    OR
    Redirect 301 /old-file-name.htm http://www.your-domain.com/new-file-name.htm
  4. Upload the file to the root directory of your server with your ftp program making sure to select ASCII as the transfer type.
  5. Test the redirect by typing in the old address to the page you've changed. You should be immediately taken to the new location.

Do not add "http://www" to the first part of the statement - just put the path from the top level of your site to the page. Also ensure that you leave a single space between these elements:

redirect 301 (the instruction that the page has moved)

/old/old-file-name.htm (the original folder path and file name)

http://www.your-domain.com/new.htm  (new path and file name)

The next time the search engines spider your site, they will follow the rule you have created in your .htaccess file. During the next update, the old file name and path will be dropped and replaced with the new one. It will NOT happen overnight.

Additional Resources

  • Change page URLs with 301 redirects
  • 301 Redirects: The What, Why and How
  • BlueHost 301 Redirects

Pat Geary.

Updated: October 15, 2018

Planning a Genealogy Website 2nd Edition is available as a 42 page EBook in pdf format for you to download. It has been totally revised and updated with new content. The EBook is zipped for faster download. Save it to your desktop, extract the file and it is ready to use.

Microsoft MVP.
April 2007 - April 2013


Disclosure: This is an affiliate link, which means that if you visit Bluehost.com through this link and purchase this product, I’ll get a commission.

Microsoft® and FrontPage® and Expression Web® are registered trademarks of Microsoft® Corporation.

Genealogy Computer Tips | Expression Web Tutorials & Templates