Home | About Us | Advertise | Free Tutorials | Glossary | Resources | Contact Us

Creating a 301 Redirect

Why do you need to worry about a 301 Redirect?

You add a 301 Redirect within your .htaccess file to establish proper search-friendly 301 redirects to manage duplicate content issues and changes to your site’s information architecture (URL structure).

Its good to keep a habit of adding a 301 redirect when you create your website, but you might get an error message from Google Webmaster Tools or Bing Webmaster Tools that you have a “URL Canonicalization (URL Normalization)” issue.

How do you create a 301 Redirect?

Simple, just create or edit your .htaccess file (located in your root directory).

  1. Find and open your .htaccess file
  2. Add the code below to the bottom of the file
  3. Replace the DOMAIN with your actual domain (DON’T FORGET!)
  4. Save your .htaccess file and replace with the existing file in your server.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.com
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]

Note: This solution will redirect any page requested via a non-www domain to the same URL with the www domain. If you want to redirect individual files from an old site to a new one, visit all 301 redirect methods.

Want More? Get Free Email Updates

The Doc takes your privacy very seriously!

No Comments Yet

Be the first to leave a reply!

Leave a comment