Welcome to Josh Baker's Practical Advice for Optimizing Your Internet Marketing blog. Here you will find internet marketing optimization and online strategy articles full of tips, tricks, discussions, and thoughts to help you take your marketing and business to the next level of success.

Basics: Creating a 301 Redirect for Beginners


When you need to permanently change the URL of a web page or your entire website, and you want your new and returning visitors and the search engines to find your new web page it’s recommended to use a search-engine friendly 301 redirect. A 301 redirect is the HTTP status code for “moved permanently”.

Some common situations for when you want to implement a 301 redirect are:

  • You want to move your entire web site to a new domain for example if you want to change the domain name of your website or you are merging 2 websites into 1 website location.
  • You changed the URL of an existing web page to a new URL, or updated the URL of an older web page where the old URL may still exist in user bookmarks, incoming links from other websites, or indexed in the search engines.

How to create a 301 redirect:

Creating a 301 redirect within a .htaccess file is the simplest way to set up a 301 redirect.

If your website doesn’t have an .htaccess file, you can create one using notepad or a text edior. When you are done entering the below 301 redirect information, save it as .htaccess and make sure that you place the period before the word htaccess and remove any other file extension such as .txt. You can remove the file extension after uploading the file, but the .htaccess file won’t work if there is an additional file extension at the end.

To 301 redirect a static web page, enter into your text file:

redirect 301 /olddirectory/oldfile.html http://www.domainame.com/directory/file.html

  • Replace /olddirectory/oldfile.html with the location of your old web page that you want to redirect
  • Replace http://www.domainame.com/directory/file.html with the location of the new webpage.
  • Be sure not to add http://www to the first part of the 301
  • Save the file and upload the .htaccess with your 301 redirect into the root of your domain.
  • If you already have information in your existing .htaccess file, just edit the existing file and add the 301 redirect information above in a new line.

To redirect an entire site to a new location, use the 301 redirect code below:

redirect 301 / http://www.newdomain.com/

  • Replace www.newdomain.com with the URL of the new domain or location you want to redirect your entire website to.

Additional 301 Redirect References:

Categories : Marketing Basics, SEO

Leave a Comment