1. Home
  2. Computing & Technology
  3. Web Design / HTML

How To Set Up a 301 Redirect with HTAccess on Apache

By , About.com Guide

If you want to redirect your Web pages without penalizing them in search engines you should use a 301 Server Redirect. But you don't need server programming to set one up, just a simple text file on your Apache Web server.

Difficulty: Average
Time Required: 5 minutes
Here's How:
  1. If you don't have a .htaccess file in your root directory, open a new text file. If you do have one there, open it for editing.
  2. At the bottom of the file, add the line:
    Redirect 301 /PATH_TO_REDIRECT NEW_LOCATION_URI
  3. Change "/PATH_TO_REDIRECT" to the directory path on your Web server you want redirected.
  4. Change "NEW_LOCATION_URI" to the URL path you want the pages redirected to.
  5. Save your .htaccess file and upload it to the root of your Web server.
  6. Test your redirect by going to the old path in a Web browser. You should be taken automatically to the new path.
Tips:
  1. Always use 301 redirects rather than meta refresh tags. They are more search engine friendly.
What You Need:
  • HTAccess
Explore Web Design / HTML
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. Web Server Management
  5. HTAccess
  6. How to Set Up a 301 Redirect with HTAccess on Apache>

©2009 About.com, a part of The New York Times Company.

All rights reserved.