Skip to main content

A 301 Redirect Guide for the Clueless

  • Author:
  • Updated date:

I mostly write about tech and digital business. I also enjoy deconstructing game strategy.


Whether you want to delete or consolidate web pages, it's always best to pass all of their search engine merit over to another existing page, to salvage visits, page rank, and old backlinks. This is what a 301 redirect will do for you!

Here, you'll find copy-and-paste examples that you can use to do all sorts of things with Apache 301-redirects, from redirecting single pages to entire categories or even entire websites.

What Is A 301 Redirect?

301 redirects are commands that point search engines and visitors from an old area of a website to another area of the site. They can also point the entire website and domain name to another website and domain name.

Where Do I Input 301 Redirects?

301 redirects go in your site's ".htaccess" file. The .htaccess is an extension-less file that sits in your root directory (/public_html) and is always accessed before your website loads, with ultimate precedence. That means that any commands in your .htaccess file will trigger before your site pops up when a search engine or a person visits it. You can edit your existing .htaccess by simply using a text editor like Notepad. Sometimes, websites don't seem to have an .htaccess file at all. All you have to do is open a text editor (such as Notepad) and save a blank page as ".htaccess", with the period before it and no extension. Drop that in your root directory—you now have an .htaccess file. Then you can add your 301 statements to it.

What's the Purpose Of A 301 Redirect?

A 301 redirect is the only way to tell search engines, as quickly as possible, that content has moved; either somewhere else within the site or to an entirely different domain name. This helps your old website sections or old website to get "updated" in search results pages in order to display their new location. The time it takes for a 301 redirect to work is immediate, but the time it takes for entries to get updated in search results is entirely at the discretion of a search engine. It usually happens faster for sites that get indexed often.


301 redirects are serious business. The instant you make a change to one, it may actually get indexed by search engines immediately. You really want to make sure you've gotten everything done correctly before testing it out. I recommend you take the following precautions before trying them out:

  • Backup your old .htaccess file before over-writing it with your new one that contains your 301 redirects. I can't stress this enough. If you are using an existing .htaccess file, it most likely has a bunch of stuff already in it. If you delete it and lose it forever, you might be in serious trouble.
  • Test your new 301 redirects after midnight or whenever your site is getting little activity. I typically do it at around 2:00 AM EST on a weekday. Note that all current visitors will either be bounced to the new locations being dictated by the 301 (if it works), or they'll see a big fat "500 error" (if you screwed up), which will confuse them.
  • Be ready to swap back in your old, working .htaccess file if your new version with the 301 redirects fails and gives you a 500 error. You definitely do not want to get indexed or visited with a site-wide error like that. Have patience and know that it might take you a couple days, in some cases, to get the entire thing working -- especially if you are redirecting hundreds of pages and categories the hard way.
  • Test out your 301 redirects on a staging account if you have the means to do so. In other words, create a dummy account on your server, copy over a mirror image of your website to it (blocking all search engines via robots.txt), and try out your new .htaccess on that dummy account. You can play around all you want without worrying about your existing site getting issues.
  • Test both individual redirects and category redirects to make sure everything is working properly, by simply visiting the old URLs to see that they're pointing to the proper area on the new site. While you probably don't have to test hundreds of redirects manually (if you actually have to do that many), still, test out a good dozen random ones to make sure everything is in order.

301 Redirect Scenarios

The 301 redirects being reviewed in this tutorial are strictly for .htaccess file redirects and the Apache web server with the function mod rewrite turned on (this is on by default). In each example, you'll see a shaded gray line with a command in it. Simply copy that command and paste it into your htaccess file, under the line "RewriteEngine on" (this is mandatory). If "RewriteEngine on" isn't in your htaccess file, simply type it in yourself.

Single Page Redirect

Old Page to New Page

Here's the most simple scenario: 301 redirecting an old page to an existing page. In this case, we'll redirect "" to "":

Redirect 301 /old.html

The first URL is the one being directed, and the second URL is the one it is being redirected to. Did you notice that the first part only requires you to type out the page, while the second link has the entire URL? This is the proper syntax, and it must be typed this way.

Old Extension-less Page to New Extension-less Page

This also works for redirecting pages that have no extension, such as the kinds of pages that are typical of a content management system like Joomla or Wordpress. Using the above example, let's assume we need to 301-redirect pages that have no ".html" extension:

Redirect 301 /old

Note that there is no "/" after the page name in that re-direct...we'll learn why, later!

Old Home Page Only to New Home Page Only

Redirecting the home page of an old website/domain name to that of a new website/domain name requires a different method, and there's only one way to do it. Use the following line, but note that it will not redirect anything else but the home page:

RedirectMatch ^/$

Non-www to www

Every single website you create should use this particular one! Here, we'll re-direct the non-www version of your website (such as to the www version of your website (such as

Options +FollowSymlinks

RewriteEngine on

RewriteCond %{HTTP_HOST} ^ [NC]

RewriteRule ^(.*)$$1 [R=301,L]

In doing so, you're eliminating search engine issues that arise from having "two versions" of a website, which also taint analytics results. Above, the code is telling the server that the domain is "[NC]" for "not case-sensitive," so that any variation of your domain will still translate over with the redirect. The "$1" after the domain means that any page or category added after it, with or without the "www.", will redirect properly.

Rename a Folder

Rename An Existing Category

Let's say you regretted naming a folder (aka category) on your website and wanted to change it. For example, you don't like "" and you wish had named it "," because it's shorter and simpler. However, you want all of the pages in that folder to still work so that they also adapt to the new "/cars/" folder. This is what you'd use:

redirect 301 /newcars/

Rename an Existing Category to Deeper Category

You can perform this redirect for deeper level folders, too. So, say you want the folder "" to move over to "/cars/all/classic/." You'd use this:

redirect 301 /cars/classic/

Unlike previous examples in this tutorial which involved redirecting from one page to another, please note that you'll have to leave the "/" after folder names in a folder-to-folder redirect. That's because the trailing forwardslash denotes a "folder."

For example, this is a page: "" and this is a folder: ""

Move a Folder

Move Category to a Single Web Page

Unlike the previous lesson, let's say that I have a folder on my site: "," and I'm getting rid of that entire folder and all of the pages within it, such as "/cars/ford.html," "/cars/toyota.html," "/cars/acura.html" and several dozen others. Since I'm no longer using those webpages, I'll want that entire folder and its contents to move to ""

RedirectMatch 301 ^/cars/(.*)$

Move Category to a Single Web Page (with extension)

The redirect would be exactly the same as the example above, except you'd simply type the page extension at the end of it. This is mostly for anyone not using a CMS like Wordpress, where the pages all have extensions, like ".html" or ".php":

RedirectMatch 301 ^/cars/(.*)$

Domain to Domain

Sometimes, a website needs to be moved over to a new domain name for whatever reason. It's a very simple thing to do, thankfully! Just copy and paste the code below (and absolutely nothing else), and make it be the sole contents of your htaccess file:

Options +FollowSymLinks

RewriteEngine on

RewriteRule (.*)$1 [R=301,L]

There are two important things to note about this. For starters, this is somewhat of a "lazy" way to move a website. You're not moving the individual folders or pages over to their new counterparts on a new website; instead, you're just moving everything over to the home page of the new site. The alternative is to write a 301 redirect command for every single folder or page, if you really need to retain each page's search engine ranking.

Secondly, when you 301 redirect an old domain to a new one, be aware that you'll have to keep paying for the annual domain renewal and server account of the old domain name. Make it a point to change all of the backlinks that were pointing to the old domain, so that they point over to the new one. Once all backlinks are changed, you can consider dropping the old domain (unless it's a good domain that gets decent type-in traffic).

Example .htaccess With 301 Redirects

After all of these tutorials, you might be really confused as to how this actually looks in a final .htaccess file. Here's an example of how your .htaccess would/should look for a few different scenarios:

Example .htaccess: Old Site/Domain to New Site/Domain (Easy but Sloppy)

Options +FollowSymlinks

RewriteEngine on

RewriteRule (.*)$1 [R=301,L]

Above: This is the .htaccess file for the old site. It's the lazy man's way of doing an old site to new site redirect, and it's not really recommended, unless your old site is really tiny, gets no visitors and has no real keyword rankings in search engines. We're just piling up the entire old site and dumping it on to the home page of the new website, called "," in this example.

Example .htaccess: Old Site/Domain to New Site/Domain (Strategic)

Options +FollowSymlinks

RewriteEngine on

RedirectMatch ^/$

Redirect 301 /old-category/old-page-1

Redirect 301 /old-category/old-page-2

Redirect 301 /old-category/old-page-3

Redirect 301 /old-category/old-page-4

Redirect 301 /old-category/old-page-5

RedirectMatch 301 ^/old-category-2/(.*)$

RedirectMatch 301 ^/old-category-3/(.*)$

Above: This is the .htaccess file for the old site. Here's a more strategic approach. We're moving over an old website piece-by-piece to a new one, called "". It starts off by first moving over the home page, with the line that says "RedirectMatch ^/$". The next 5 lines are moving over single pages from the old site over to a page on the new site called "new-page." Obviously, those old pages (old-page-1, old-page-2, etc) are being treated as obsolete, and we're just telling search engines to point any references of them over to "/new-page". Lastly, the two "RedirectMatch" lines are moving over two entire categories and all of their pages over to a new page on the new website called "blue."

301 Redirect Statements

  • Options +FollowSymLinks: You might see this in your existing htaccess file, before "RewriteEngine on". It's a statement that enables your "Mod Rewrite" function.
  • [NC]: The statement [NC] can be used within a 301 redirect rewrite rule. It simply tells your server that the value before it is not case sensitive, and ignores differences between capitalized and non-capitalized letters.
  • [L]: This statement, when used at the end of a rewrite rule, tells the server that it is the "last line" in the set. Anything that comes afterward will not be processed as a "set." In other words, the line under it won't be read as a "part 2" of the line above it.
  • "Redirect 301" vs "RedirectPermanent": In case you saw this in another tutorial and it's driving you crazy, note that these two statements, which appear at the start of a single-page redirect, are synonyms. Both will perform the same action.

"500 Error"

If you're getting a "500 Error" after testing out your site, be sure to swap back in your old .htaccess file immediately. Then, open the errant one and take a look at everything.

If you missed just one single character on just one line, such as a missing ^ or $ or /, the entire thing won't work! Find where you've made this error, correct it, and try again.

If you can't seem to fix the issue, start deleting lines one by one, and re-testing the file. Usually, it is a case where your "single page to single page" redirects are working fine, but you have a syntax error on one of your "category to single page" redirects. So, delete all of the "category to single page" ones, and re-try the .htaccess file again.

More 301 Redirect Tips, Tricks, and Info

  • 301 redirects are always instant because the .htaccess file is read before a page loads. In other words, there's no "wait time." If it doesn't work right away, then it's not working, period.
  • Never forget: if you're 301-redirecting an old site to a new one, you're going to pretty much have to hold on to the old site's domain name and server account forever, if it has tons of old backlinks that are impossible to manually update. It's far too risky to give up the old domain name/account if it's going to drop tons of backlinks from your portfolio, because your search rankings will sink like a rock.
  • When you've done a 301 redirect, check all pages involved: if you've redirected a main page, check both that page and several of its sub-pages to make sure they are behaving the way you've anticipated.
  • 301 redirects pass all page rank and SERPs [Search Engine Results Pages rankings] - making them a vital part of an SEO roadmap for a changing site. The passing of page rank from a 301 redirected page to another page will not be instantaneous.
  • If you made a change to your 301 statement within the .htaccess and it still doesn't work after testing it, clear your browser's cache and try again. This is a rare scenario, but something worth trying.
  • In regard to how much "credit" a 301 redirect passes from an old source to a new one, it's estimated that it will pass around 90%-95% "juice."

Comments & Feedback

Gaurav Saklani from Mumbai on August 21, 2020:

Thanks for sharing such a wonderful article as i waiting for such article

Ozanera on March 04, 2020:

Thanks for sharing such a wonderful article as i waiting for such article

Keep on sharing the good content. to the Ozanera Products and Services Portal Over the years we’ve seen doctors and hospitals really struggle to find reliable hospital products and services fast. Thank you

long shu juan on September 25, 2019:

the article is very good ,if know much ,please visit

Redirect Tracker on July 15, 2019:

This blog is very interesting to read. The information shared here is very helpful. Thanks for providing these wonderful websites.

Daniel on March 21, 2019:

Now I have a directory

I want to redirect this directory to a different page but retain pages within that directory. For example, I want to retain

How do I go about that?

Kim Wist from Finland on March 15, 2015:

Thanks, a very useful article.

I have one question concerning my own site and 301:

I made a new website last summer and changed many page names in the process. Littele later I discovered that my rankings dropped from google's page one to page two. I didn't undrestand why, until recently when I realized to redirect all the old page names to the new ones via .htacess.

Before I did this redirecting, I was using google's webmaster tools and asked all the old pages to be removed. There was increase in not found errors and I thought that getting rid of old pages this way is the solution.

It took some time but they were successfully removed.

After this I did all the redirection in my .htaccess, only to find that now I'm sitting in the middle of google's 4:th page.

Was it a mistake to remove the pages via webmaster tools or is this normal that ranking drops this much after 301 redirects?

Usman Khan Niazi on March 13, 2015:

Thank you so much for a comprehensive blog post on this issue.

anonymous on June 14, 2013:

This was very helpful and straight forward, thank you.

mariacarbonara on May 31, 2013:

Interesting that Squidoo are now testing using 301 to redirect to subdomains. Lets hope they have read this!

alex wolstencro on March 14, 2013:

I got a brain buster for ya. I got an affiliate site setup with wordpress that uses a 301 redirect plugin that I use for the posts (because they are images with rollover previews) and just switched from 302 and I didn't even know the plugin was 302 and not 301 until I tested I so now I hope my SEO will be better, but my question is: Is it possible for the search function to pull data from the 301 directed url associated with of corresponding post permalink, to display the featured thumbnails in search results? would I need a spider for something like this? because I don't know how a wordpress function could go outside of wordpress itself, but maybe it's possible, otherwise my plan is to enter the keywords i see in each store manually in the post content box which would be a lot of work cause I already added 230 stores! what are your thoughts on this concept?

anonymous on December 06, 2012:

Thank you! You made htaccess and 301 redirects easy to understand.

anonymous on November 13, 2012:

Where are these 301 redirects supposed to be entered? (on the header of each page at the old site?)

anonymous on October 22, 2012:


I really need your help regarding an issue I'm facing with .htaccess file.

I've recently moved my website from html to php. Now, I want to redirect few old html pages to new php pages. The problem is that the file names are different.

Example: How to redirect:




anonymous on October 22, 2012:


I really need your help regarding an issue I'm facing with .htaccess file.

I've recently moved my website from html to php. Now, I want to redirect few old html pages to new php pages. The problem is that the file names are different.

Example: How to redirect:




anonymous on October 08, 2012:

Hi Great Post, can anyone help me with the following I have say but if someone inputs I get a 404 so how can I check for no extension and add the .php

anonymous on September 28, 2012:

Perfect post! Maybe you can help me out: I need to redirect (301) most pages of an old website to a new one. Not all old pages will have a new one, so I want to redirect each page manually.

The problem is, that which url/page I need to use to redirect the homepage to a new one. The homepage seems to be indexed without an additive and doesn't seem to have an index.asp, index.php, or index.html.

How can I redirect (using a htaccess file) both my homepage and other pages without overriding one and another?

webguru_india on September 27, 2012:

it's an amazing guide

anonymous on September 20, 2012:

@anonymous: If you're using Windows 7, open the folder that has your .htaccess.txt file in it.

Click the 'Organise' button then select 'Folder and search options'.

Select the 'View' tab.

Scroll down the list and uncheck the box that says, "Hide extensions for known file types", then select ok.

You should now see .htaccess.txt

Delete the .txt = Happy Days :-)

anonymous on August 20, 2012:

Update: I found a site that said to create in Notepad with the .txt extension, upload to the server, and THEN rename it. Sounds logical, but the server won't let me rename. How in the heck can I make this work? It shouldn't be this difficult! Thanks in advance for any help.

anonymous on August 20, 2012:

@AngelaKane: Angela, what's your secret? I can't seem to create the simple .htaccess page without it having an extension. Can you help me?

anonymous on August 20, 2012:

This is ridiculous - I cannot create a Notepad file named .htaccess without it insisting on putting an extension on it.

I've tried to rename the Notepad without the extension, but no success.

Did the same in Wordpad, with the same results.

Talk about clueless - I can't seem to get to square one in this.

How in the world do I make a file named .htaccess without an extension? Can somebody help me?

AngelaKane on August 16, 2012:

Thank you, I was looking everywhere for simple page to page 301 redirect and your examples worked perfectly.

anonymous on August 01, 2012:


my current website is sitting in a directory and i have another directory created for the new webpages for the same domain.i created htaccess which has redirect 301 of old webpage to new webpage and loaded it up in the new directory

1.the old directory sturcture is completely dirfferent from the new one

2.first when i changed my root directory to the new directory it gave me an internal error 500 and when i removed the htaccess the website worked.

3.the 301 code in the new directory was Redirect 301 /old.html

4.the new directory will not have any pages of the old directory.

can someone help me where things went wrong. any suggestion is greatly appreciated

anonymous on July 23, 2012:

So, I want to remove a page completely from my site, should I redirect its traffic to the index page? Would that be a smart choice?

jeffster on July 14, 2012:

Thanks. I'm just buying a site with a PR3 and lots of PR2 inner pages and this information is just what I need.

anonymous on July 01, 2012:

Hi, how do I control when they type in the old site different ways? For example... If they type, or I want all of these options to lead to Thoughts? Thanks a million.

anonymous on June 21, 2012:

Thanks for posting this it has helped me fix two versions of my home page!

anonymous on May 30, 2012:

Hi, Thanks for the all useful information. But i have a problem in my .htaccess file.

actually i want to remove case sensitivity from 301.

Options +FollowSymlinks

RewriteEngine on

rewritecond %{HTTP_HOST} ^ [NC]

rewriterule ^(.*)$$1 [R=301,NC]

this is the text as you suggested. i had used NC/nc both type but no effect.

Can any one please suggest me ASAP.......

Thanks In advance.....

anonymous on May 29, 2012:

@anonymous: Hi faheem, have you tried adding a forward slash at the end of the old URL?

anonymous on April 25, 2012:

thanks for the help but i am having a little different problem like i want to re direct to pages as they are the same and Google is indexing them as different can any body suggest me something and using htaccess file very important

anonymous on April 25, 2012:

Thanks for the info - maybe you covered this but how can I have the old site address point to a neww address. We don't need the files. All we need is to have the old domain redirect to the new domain. Old domain is hosted on site new domain is hosted offsite. Does that make sense?

anonymous on March 14, 2012:

@anonymous: Ah, have figured it out, the above code is correct - have just noticed I added a line above it for another redirect which was redirecting the redirect!!! Example below:

redirect 301 /products

Hope this helps anyone else out who is having similar problems - check out any other 301 redirects you are using just in case they are causing conflicts

anonymous on March 14, 2012:

Am having a few problems with the 301 redirects, essentially what I have done a bit of housekeeping with folders and files on my website and removed a few folders, and moved and renamed the files in that folder, example shown below:

redirect 301 /products/myproduct1.shtml which in theory as I understand, should redirect to:

However, what is now happening is that the redirect goes to: which doesn't exist so is a 404 - please note that I also renamed the old file from .shtml to .html - it's not a typo!

Would be great if someone could point out what I'm doing wrong.

anonymous on March 13, 2012:

Great lens! Needed a read up about 301 redirects and you have given me an insightful basics.

daviddaly on March 08, 2012:

Thanks. It's very helpful. Can you do the 301 redirect just on your website or do you need access to the webserver? I'm trying to do it for my spirulina site.

anonymous on March 08, 2012:

Thanks. It's very helpful. Can you do the 301 redirect just on your website or do you need access to the webserver? I'm trying to do it for my spirulina site.

anonymous on February 20, 2012:

Thanks for the well presented and easy to understand information on 301 redirects. With so much conflicting and useless information on the subject, it was a delight to find your article.

It was a long haul, but i've just managed to redirect around 700 URL's, all of which are working fine.



anonymous on February 17, 2012:

Hi, Can I redirect my existing web page with 302 to a squidoo lens with the same content?

Mark N (author) on January 10, 2012:

@altamiraweb: Follow the "single page redirect" above, but point it to If there are too many pages and if this would take too long, then re-direct all of the folders to

Mark N (author) on January 10, 2012:

@upstarter lm: It depends on if you want those individual pages to maintain their SE rankings. If the pages are high up in search engines, it is worth your while to 301 redirect every page individually. Otherwise, just redirect the folders and re-submit an XML sitemap.

altamiraweb on November 17, 2011:

@upstarter lm: How can I redirect the inner pages of a domain to the homepage?

Mi site is Posicionamiento web en Google

upstarter lm on September 21, 2011:

If I want to migrate to new domain, do I have then to 301 redirect the whole site (every link individually)?

RebelPhoenix on September 02, 2011:

Great, all important info in one place, thanks!

equotemd on August 04, 2011:

Excellent lens! This is by far one of the most concise and easy to read .htaccess tutorials I have ever read.

TerrieSoberg LM on July 30, 2011:

Thank you for this great lens - you just saved my site!

andreloxas on July 14, 2011:

Great lens!

ElizabethLombardi on July 14, 2011:

@Satty_Kassoana: Hi Satty_Kassoana:

I just did exactly what you are thinking of doing, new pages, new page names, but the same domain. You have asked a perfect question for the google webmaster forum These people are experts and will help you. As far as duplicate content, yes you will have it, so remove all the old pages. Google will eventually drop them from their index and you new ones will show up.

A word on WordPress. I design websites in HTML. I also had some blogs in WordPress. I struggled with WordPress for 9 months and finally dumped the software last week. WordPress is not as stable as everyone says when you have multiple blogs. If you only plan on one, go for it, but my multisite crashed often, especially when I did updates. It was very frustrating and I finally moved all the blogs to html. See my little site I made the site look like a blog, it was pretty easy. I use Dreamweaver and Photoshop to make sites, much easier than WordPress.

gatorsquid on July 13, 2011:

good lens!

gatorsquid on July 13, 2011:

good lens!

nielpet on July 05, 2011:

You outlined the 301 redirects quite well. You did mention that for the old pages that have no backlinks. we don't have to worry about redirecting them and just submit the new sitemap to google webmasters. I wanted to ask - what if the old pages are showing up in the "Crawler Errors" section of google webmasters. Should we worry about that or will it just go away after awhile?

anonymous on June 28, 2011:

This info is enormously useful. I have done a lot of research myself on 301 redirects but I found that all the various issues of it are combined in this single lens. Thank you for a job well done. I not only liked this lens but I also Google +1 as well.

ElizabethLombardi on June 27, 2011:

I have a website that is having problems with Google and dropped from search results due to my mistakes. I purchased several related domains so nobody can copy my unique site, one of which is I have 301 Redirects set in GoDaddy for these unused domains to point to The Fish Chum Pro. Am I getting penalized by Google for doing this?

I would like to add a little history, I have several sites and a Wordpress blog on my GoDaddy server. The actual websites are under a directory _sites with under _sites/fishchumpro. Could this be a problem? I also in the beginning set the unused domains in the Domain Management module to point to _sites/fishchumpro and I found out when I got dropped from Google this is not the way to forward, it looked like I had 5 websites instead of 1. So I fixed this, removed the URL's from Googles index, and put up 301 Redirects. Is this OK? I am desperately trying to fix this mess.

hniizato on June 05, 2011:

It worked! Thanks so much.

skygate on April 27, 2011:

To achieve online marketing success, the first step is to design a website for your retail orweb design Houston, TX A website that is designed according to your offline image covers the very important basics: who you are, what you do, where you are and how to find you. With strategic planning, creative web design ideas as well as thorough market and competition research, a website can be the quickest way to attract perspective customersâ interests.

skygate on April 27, 2011:

To achieve online marketing success, the first step is to design a website for your retail orweb design Houston, TX A website that is designed according to your offline image covers the very important basics: who you are, what you do, where you are and how to find you. With strategic planning, creative web design ideas as well as thorough market and competition research, a website can be the quickest way to attract perspective customersâ interests.

skygate on April 27, 2011:

To achieve online marketing success, the first step is to design a website for your retail orweb design Houston, TX A website that is designed according to your offline image covers the very important basics: who you are, what you do, where you are and how to find you. With strategic planning, creative web design ideas as well as thorough market and competition research, a website can be the quickest way to attract perspective customersâ interests.

301redirector on April 19, 2011:

Thanks for the tutorial.

I'm working on an online tool that you may find interesting. It creates 301 redirects automatically for you. You don't need lists of old and new URLs. It's particularly useful if you're running a larger site (such as an online store) where creating redirects by hand would take too much time.

Check it out at:

LAworkhorse on April 13, 2011:

If I deleted a bunch of pages, too many to redirect 1 by 1, how would I redirect all the missing pages back to the home page?

kathleenrhodes on March 22, 2011:

What happens to backlinks? I have a that I did a 301 redirect for - to go to (There is also a blog on the website, I did the redirect on March 17th. When I checked yesterday, 3/21 I found that I had lost the ~3800 backlinks that I had. When I removed the 301 redirect, they all came back. Did I just not wait long enough for the Google PR update cycle or do you think I did something wrong?

mknjhill on March 17, 2011:

I got a question for you then, I have one i just can't figure out. i need /post2host/?page=tos redirected to /tos.php i stumbled on this lens by accident, and am hoping you can answer my question. Thanks.

anonymous on February 13, 2011:

great tutorial about 301 Redirect Tutorial. Angel Blessed:)

Satty_Kassoana on January 09, 2011:

Hi very nice tutorial. Thank you. But I have a few questions. I have a website which ranks excellent for a keyword/s. But I made that site 3 years ago with simple HTML and looks a bit outdated. So I am planning to convert that old site (all 30 pages) into a more stylish wordpress modified theme based site. I mean all the pages and navigation will be same but now they will reside in a wordpress site. ALso .HTML will be now .PHP (as it goes with wordpress).

So my questions are, if I do 301 redirect:

1. Will I be keeping all old pages as well? or they will be deleted but .httpaccess file will simple let search engines know "for this page, go here"?

2. If I keep old pages, will there be any negative impact on my page rankings because I will have duplicate content now?

3. Will my page ranking will be lost if I convert all (same) content into wordpress and redirect it?

I will be very thankful for you answer.

bt55 on November 24, 2010:

Nformative.Thank you. I did not have enough information on 301 redirects. Well done,

tamalds on November 11, 2010:

Brilliant, awesome, spectacular buddy, you just saved me! I redirect my site to and also did a check on existing url's they work like magic, all of them! BIG THANK YOU!

KBellamy1 on November 02, 2010:

Exactly the information I was looking for. Thanks!

Thamisgith on October 06, 2010:

Thank you so much for that. Saved my bacon.

anonymous on October 05, 2010:

This tutorial will be very useful for me as the time that I know that I can improve my performance in athletics just consuming Generic Viagra. Thanks for presenting this information. Viagra Online Buy Viagra

anonymous on October 05, 2010:


RebeccaE on October 03, 2010:

you have just saved a more nontechie mind from complete disaster, I was thinking of doing some redirects, and this explains it a lot better to me.

anonymous on September 16, 2010:

Informative lens.You share a very informative lens with Best Business Directory team.

Mark N (author) on August 02, 2010:

@Ajeet: Yes - some sites have hundreds. It's not recommended to have that many, though - keep in mind that they all have to be read before a site is loaded!

Ajeet on June 30, 2010:

I assume that having many such lines in the .htaccess is ok, right?

Redirect 301 /old1.html

Redirect 301 /old2.html

Redirect 301 /old3.html

Redirect 301 /old4.html


Dominical on June 29, 2010:

Excellent article and boy oh boy can I relate to it. 301s can be the biggest source for a migrane for any SEO. I had changed my Joomla CMS site completely including the URL structure. I really wasn't looking forward to writing 301s for all of the pages (1000+) so what I did (with the help of Google) is I wrote a variable 301 that covered all my pages using variables and I did this using only 3 different 301s. AND IT WORKS!

Check it out @ Costa Rica SEO

solutionoriented on June 11, 2010:

Here's my issue: When we transferred all of our information over to a new web site, we went to Yahoo and Google and did a redirect from our old site to our new site and it worked well.

We then gave ownership of the old web site domain name to a new owner. That new owner immediately put up their new web page, so we lost our redirects.

The new owner of the web site only has up one page, the home page. But my problem is that we lost all of our redirects from the folders within the web site.

How can I get control of my folders when the old site is controlled by a new owner?

Thank you

vette09 on April 22, 2010:

You rock my world. You are the ONLY tutorial I found that included this "RewriteEngine ON" info

Amarca on February 16, 2010:

Hi, your post is very useful!

I got a question. If we want to leave a page announcing the brand (and domain) change in the old site so visitors don't get confused when getting another website with a different brand and domain instead of what they were expecting to see, how do we do the redirects? Please keep in mind the following:

- The old domain will be kept working.

- The home page in the old site ranks first in google and the a product page (within the site) ranks second.

So to make it clear, we want visitor to see a transition page (that links to the new site) when accessing the old site but want to make sure we retain the ranking and at the same time, redirect all other pages in the site.

Also, can you please confirm that transferring a domain from one registrar to another will not affect the site's ranking.

Thank you for your help.

vlili on January 19, 2010:

good post! I have tried Redirect 301 /old.html for the homepage, for example many site has index.php and if point /index.php to then it broke the page due to too many redirect.

my personal blog is, hope to more communicate

Steve-Wilson on December 04, 2009:

Thanks for this. I came across a lot of 'geeky' sites that failed to point out the need for RewriteEngine ON, so I wasted a lot of time until I found this.

Mark N (author) on September 25, 2009:

[in reply to Rhinoooow] Thanks for the info! I've corrected it.

Rhinoooow on September 22, 2009:

Very good, but you've incorrect with the warning about L. It only stops processing other rules if this one matches.

Sometimes its ESSENTIAL - e.g. a CMS system that rewrites pages but you have rule to 301 an old page to a new one - you don't want both rules running at the same time.

GoldLizard on June 08, 2009:

THANKS for this thorough guide! I've bookmarked this page and I'm rating it 5 stars.

logiclabz on March 25, 2009:

Being a SEO beginner learnt

to redirect. Good and clean post

We can use the URL Redirect Checker to check any status code like 301, 404, 302 etc.

CarolSue on November 16, 2008:

a great lens with useful information! had a problem with my redirects and he was kind enough to email me personally and help. A plus to have this type of member in our squidoo community!

LisaDH on October 11, 2008:

Just the info I've been needing. Thanks!