Need to change your domain name? Create 301 Redirects

Need to change your domain name? Create 301 Redirects

0 3033
301 Redirects - Bossa Nova Interactive

301 Redirects - Bossa Nova InteractiveSome years back, we changed our domain name from to This year, we’re changing the entire business name to Bossa Nova Interactive, and of course that means yet another domain name change. To make sure our pages don’t get lost to users or to search engines, we’ve incorporated 301 redirects yet again.

How to implement a 301 Redirect

Here are the steps that we took to redirect all of our pages, sub-folders, and paths within our old website at to our new website We chose this exact method for several reasons, chief among them that we wanted to let Google and other search engines know that the pages have been permanently moved. We also changed the folder and category structure of our site, so it was important to map each page’s path to the new page’s path. If we had simply redirected the entire top level domain, all users would be redirected to the home page of the new site (which is a bad user experience,) and we may have also lost ranking on certain articles.

About 301 Redirects

While there are many ways to redirect a page, the 301 method is the one we’re using because it is a message to search engines that the pages have permanently moved. And there are also many types of 301 redirects, but we’re going to be showing you how we used an .htaccess file for ours.

You will need:

    • An FTP Client (Transmit for Mac or Filezilla for PC)
    • A text editor (TextMate for Mac or Notepad ++ for PC)
    • A list of all of your pages, or a site map. Here are two ways to get it: *
      • If you’re on WordPress (self-hosted) install a plugin to help render a sitemap.xml for Google. You may already have this, so check your root folder for a file called sitemap.xml. If you have the plugin installed, regenerate the site map file before you start. Put it into a text editor, and remove everything except for the actual full URLs from your site.
      • Or you can manually map out the URLs from your website. Click on each page or post and copy the URL down into a blank text file. You can also perform a Google search using site: and your exact domain name (ex:

*if anyone knows a better way to get a plain text list of a site’s URLs, please leave a comment below or contact us.

Plain text file with URLs listed

Once you have your URL list, go ahead and save the file as url-list.txt

Got that saved? Ok, good. Now save it again as url-path-list.txt This will be a list of your subfolders, pages and paths underneath of your domain name. It’s okay if you don’t quite follow this step yet, but trust us when we say you will want to keep two copies of the URL list, one unedited for later use, and one that we’re about to use now.

Editing url-path-list.txt

Remove the domain name from each URL, from the http:// to the .com(or whatever extension you’re using. Leave the trailing slash ? / ? and anything after it. See below example:



For the home page, we’ll add index.php (or .html, or whatever your website setup is using. For WordPress, it’s most likely index.php) to the trailing slash so our list looks like this:

After (edited)

Remove the domain from each URL in your list as the above example states, plus add index.php to the home page after the trailing slash. Save the file and move on to the next step.

Htaccess File

  1. Start by creating a blank text file called htaccess.txt
  2. Next, copy the list of paths from url-path-list.txt and paste them into htaccess.txt
  3. At the beginning of each line, type redirect 301
  4. After the path on each line, type the full URL of the page where you want the site to redirect. Our paths were a little different due to some changes in naming convention on the new site, as shown below.
    redirect 301 /index.php
    redirect 301 /work/
    redirect 301 /about/
  5. Complete that process for all of your URLs and save htaccess.txt
  6. Upload htaccess.txt to the root of your webserver (typically public_html or similar.)
    Note: You need to upload this to your OLD server, not your new server.

But wait, there’s more!

Don’t stop now, because there’s still the matter of moving that period in the file name. An .htaccess file is usually a hidden file located in your public_html folder. You can usually see it with an FTP client, but if you downloaded an .htaccess file to your computer, you may not be able to see it. That’s why we saved it as a .txt file first, then uploaded to the server. But wait, there’s even more!


If you do, then try to open the copy that is on the server from inside your FTP client. In most cases, you can right click on the file on the right side window of the FTP program, then select “Open With” and choose your plain-text editor. Copy the contents of that file and save them to your htaccess.txt file on your computer.

Often the mod-rewrite code that WordPress needs for permalinks and other functions are in this file. You can place their code at the bottom of your list. Note our example at the end. Obviously if you are redirecting every page from your old site, then you don’t need to worry about the existing .htaccessfile. However, you can use this method to only redirect one or two pages to anywhere you’d like.

  • Again, upload your htaccess.txt file to your server.
  • From the file list on the server, rename htaccess.txt to .htaccess which can be typically done by right clicking on the file name on the right side window of the FTP client and renaming the entire file name. Don’t forget to remove the .txt
  • Your redirects should now be live. Test them with the Redirect Checking Tool from Ragepank. If you’re interested, here’s what our final .htaccess file looked like.
    redirect 301 /index.php
    redirect 301 /work/
    redirect 301 /about/
    redirect 301 /contact/
    redirect 301 /archives/
    redirect 301 /links/
    redirect 301 /blog/
    redirect 301 /virginia-beach-rock-gym-website-redesign/
    redirect 301 /the-heroes-art-ball-site-website-design/
    redirect 301 /standards-based-web-design/
    redirect 301 /301-redirects-and-the-googlebot/
    redirect 301 /best-practices-for-wordpress-titles/
    redirect 301 /privacy-policy/
    redirect 301 /hampton-roads/
    redirect 301 /ziggity-zoom/
    redirect 301 /mommie-911/
    redirect 301 /friends-of-geraldine/
    redirect 301 /kemper-consulting/
    redirect 301 /casa-amarilla/
    redirect 301 /wordpress-3-0-and-nextgen-plugin-upgrade-issues/
    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress

Got questions? Know a better way? Leave a comment below.

 Name: Email: We respect your email privacyPowered by AWeber Email Marketing Software 


Leave a Reply

This blog is kept spam free by WP-SpamFree.