How To Do a 301 Redirect

So you want to set up a 301 redirect for your site but aren’t sure how to do it. Don’t worry. We’ve got you covered. Use our guide to understand how and why to implement a 301 redirect on your site.

What is a 301 redirect?

301 redirect: A 301 redirect is a permanent redirect that sends users and search engines from one page to another. It indicates that a page has moved permanently and passes ranking power from the old URL to the new one. When a visitor encounters a 301 redirect, it sends them to a different webpage from the one they requested initially. This is the most common method of redirection and is used when the content on a page has been moved forever. It works by sending the “Moved Permanently” HTTP status response code to the browser or web crawler along with the new destination URL.

The HyperText Transfer Protocol (HTTP) 301 Moved Permanently redirect status response code is used to indicate that the requested resource has been definitively moved to the URL given by the Location headers. Search engines update their links to the resource, and a browser redirects to the new URL. A 301 redirect informs online visitors that a webpage has moved and forwards them to a live, working URL. The number 301 refers to the HTTP status code for this redirect type, issued in response to browser requests. The 301 redirect is the most recommended method of implementing redirects on a website.

Think of a redirect as a change of address card for the web. As long as everything is done correctly, a 301 redirect will ensure that you keep the link value earned by the old page and help to prevent duplicate content that could arise if the engines were to index both versions of your page.

Learn how to properly implement 301 redirects on web servers (Apache or Microsoft). If your page moves, you must do this or lose your search rankings.

Read on for information about:

Do a 301 Redirect

How to Do a 301 Redirect – Using .htaccess for Apache

Make sure you have access to your server and your Apache configuration file and that you can use your .htaccess files. The ability to use .htaccess files will reside in a command called “Allow Override” in the Apache config file. If you do not have this access, you’ll have to first call your hosting company and get access.

Once you know that you have access to this file, your next step is to locate it. The .htaccess file is a control file that allows server configuration changes on a per-directory basis. It controls that directory and all of the subdirectories contained within. In most cases, this file will be placed in the root web folder for your site. If there’s no .htaccess file present, create one.

To begin using the .htaccess file to 301 redirect page(s) on your site, open up your FTP and login to your site. Work your way into the root web folder in order to access your .htaccess file.

(Note: The dot in .htaccess makes it a hidden file, so make sure your FTP browser is enabled to view hidden files.)

When you start editing the file, use a UNIX-style text editor rather than Notepad. Typically, an HTML editor or code editor such as TextPad works just fine. To 301 redirect pages using the .htaccess file, you will add a line to the file that tells the server what to do.

To 301 Redirect a Page:

RedirectPermanent /old-file.html

To 301 Redirect an Entire Domain:

RedirectPermanent /

Once you have inserted the commands to 301 redirect your pages, you need to ensure a blank line at the end of the file. Your server will read the .htaccess file line by line, which means at some point, you’ll need to throw it an “endline” character to signify that you’re finished. An easy way to do this is to put a blank line at the bottom of the file.

How to Do a 301 Redirect – Using IIS on a Microsoft Windows Server

Navigate your way to Internet Information Services (IIS) Manager, which is found with Administrative Tools within the Start menu. From there, you will find a panel on the left-hand side that lists all your sites. Choose the site you want to work on.

Once you select it, several modules come up. Verify the URL Rewrite module is present. If it is not, you can install it here.

Once you have it, double-click to open the module. On the right-hand side, you will see an option to Add Rules. Click it and then select Blank Rule under the Inbound Rules section. Hit OK. This will take you to an Edit Inbound Rule page. Type a name for the rule, such as Old Domain Redirect or Old Page Redirect.

Go to the Match URL Panel. Set the requested URL at “Matches the Pattern” and then Using as Regular Expressions. Now you will specify if you’re redirecting a single page, a group of pages, or an entire domain:

  • To 301 redirect a single page, type in the page name under Pattern. For example, if we were redirecting this blog post, we would input blog/how-to-properly-implement-a-301-redirect/ in the Pattern field.
  • To redirect the entire site, we would input (.*) in the Pattern field.
  • To redirect all the pages on within the SEO folder, we would input seo/(.*)

Make sure “ignore case” is checked.

Skip down to the action panel and select Redirect within the Action Type drop-down menu. In the Action Properties, type in the new URL. If it’s a single page, input the single page. If it’s the entire domain or a group of pages, type the new destination with a back reference, which is {R:0}. The back reference will keep all page URLs intact with the new domain.

For example, if we were changing to, we would input{R:0}

If you use tracking parameters and you want them to carry through, check Append Query String.

In the Redirect type field, select Permanent (301).

Click Apply at the top right in the Actions column to save the redirect.

(If you want to review the 301 redirect, hit back to rules in the Actions column.)

After you save this redirect, the rules you created are saved into the web.config file, which you can edit in the future.

Alternative Methods to Implement a 301 Redirect

If you don’t have access to your .htaccess file or your Windows Server Administration Panel, you can do 301 redirects with code on your old pages. If your pages are in PHP, ASP, Java, or any other language that allows you to modify response headers, simply place the code at the top of each page to do the permanent redirect.

Redirecting pages is just ONE skill an SEO has to know. At BCI, we help clients with not just the SEO how-tos, but also the strategy questions they need to optimize their online revenue. Want to explore how we can help you? Request a conversation or call us today.

Why You Might Need to Implement a 301 Redirect

There are many times a 301 redirect makes sense. Here are a few of the most common:

  • You’re changing your entire root domain.
  • You want to reorganize pages by changing or removing a directory.
  • Let’s say CNN posted a link to this blog post, but the URL was incorrect. We’d still want to capture the traffic that is going to a 404 page. So we’d put in a 301 redirect to direct users from the bad link to the right URL.
  • You want a vanity URL.

Note: If you’re concerned you might lose PageRank through a redirect, know that any fluctuations will be temporary. Google Webmaster Trends Analyst Gary Illyes recently gave this assurance:

Have any questions about implementing a 301 redirect? Ask us in the comments, and we’ll be happy to help you.

This post, originally written in 2007 by Lisa Barone, is among our most-visited blog posts of all time, so we keep it up-to-date and accurate. Thanks for visiting, and I hope it helps!

FAQ: How does a 301 redirect contribute to preserving SEO rankings and user experience?

When it comes to maintaining a strong online presence and keeping up with evolving web dynamics, understanding the ins and outs of 301 redirects is a must. These redirects aren’t just technical tricks but strategic tools that directly impact SEO rankings and user experience. A 301 redirect is akin to providing a forwarding address when you move. It ensures that both users and search engines know that a page has been permanently moved to a new location.

Preserving SEO rankings is a chief concern during website migrations or content updates. A 301 redirect signals to search engines that the content has moved permanently and prompts them to transfer the existing ranking value to the new URL. This transfer of authority prevents a loss in rankings and maintains the website’s credibility in search engine results. This process is particularly vital for websites that transition smoothly while retaining their hard-earned SEO equity.

User experience is paramount in the digital realm, and a well-implemented 301 redirect can make all the difference. Imagine a user clicking on a bookmarked page or following a link only to encounter a “404 Page Not Found” error. This not only disrupts their journey but can lead to frustration and abandonment. By employing a 301 redirect, you guide users to the correct page, ensuring a seamless browsing experience. This practice retains visitors and contributes positively to your website’s bounce rate and overall user engagement.

However, the effectiveness of a 301 redirect lies in its implementation. A meticulous approach is required to accurately map old URLs to their corresponding new destinations. It’s also crucial to ensure a proper HTTP response code (301 Moved Permanently) is communicated to browsers and search engines, indicating the permanent move. Regularly monitoring and promptly updating these redirects when necessary is also recommended to maintain a healthy user experience and SEO performance.

The strategic use of 301 redirects is a cornerstone of successful website management. By preserving SEO rankings and enhancing user experience during content transitions, these redirects bridge the old and the new. Employing 301 redirects effectively speaks to your website’s technical prowess and reflects your commitment to providing a seamless and user-friendly online journey.

Step-by-Step Procedure:

  1. Identify the need for a 301 redirect (e.g., content migration, URL changes).
  2. Create a list of old URLs to be redirected.
  3. Decide on the corresponding new URLs for each old URL.
  4. Access the website’s server or hosting control panel.
  5. Determine the server type (Apache, IIS) to choose the appropriate method.
  6. modify the .htaccess file in the root directory if using Apache.
  7. Access the Internet Information Services (IIS) Manager if using IIS.
  8. Enable the URL Rewrite module if it’s not already enabled.
  9. Create a new rule for inbound URL redirects.
  10. Choose the appropriate redirect type (Permanent – 301).
  11. Specify the pattern to match the old URLs using regular expressions.
  12. Define the action type as “Redirect” and provide the new URL.
  13. Configure any query string parameters if needed.
  14. Save the rule and test the redirect for accuracy.
  15. Ensure proper HTTP response code (301 Moved Permanently) is returned.
  16. Monitor the effectiveness of the redirects regularly.
  17. Update redirects when new changes occur (e.g., new content).
  18. Maintain a clean and organized redirect mapping.
  19. Address any potential issues promptly to prevent negative impacts.
  20. Continuously assess the impact of redirects on SEO rankings and user experience.

See Bruce's author page for links to connect on social media.

Comments (92)
Still on the hunt for actionable tips and insights? Each of these recent SEO posts is better than the last!

92 Replies to “How To Do a 301 Redirect”

I really loved your blog. It helped me understand the 301 redirection quite easily. Thanks. Looking forward to more such blogs.

How about if we do a redirect on Domain server level – i.e. like if you check Godaddy they give you option do you want to move domain (old URL) to a new URL.

Robert Stefanski

Hi Drone Ninja,

Thanks for your question! A redirect on the domain server level is OK as long as that redirect results in a 301 redirect AND the subpages for the URL are also redirected in a way that you want them to be.

Amazing article, very helpful and informative. Thanks for sharing it.

Extremely helpful. Thank you for sharing this information I will surely apply it on my website.

Very nice explaination about 301 redirection. You have nicely explained about implementation of 301 redirect.

Very informative. This blog helps us to make a better understanding of how can we redirect 301.

its crazy to think how 301 redirects could impact your SEO efforts.

Bad method, avoid it.

It counts as a 302 redirect.
With a 200 OK on both the start and target page, the search engine index both the start page and the target page.
Since this method is a known spam method, it is best to avoid it.

I’m not sure what you’re asking here. If you don’t want a file to be indexed, then yes, use the robots.txt file to exclude it.

This defines index-d.html as being the first page that the server looks for on a directory request. If it can’t find that page, then it will go to index.html and so on.

I have a question about 301 permanent redirect and your advice will be great. I have an website about snoring and on that website are 2 related articles, 1 of them ranks for a lot of kws position 2-10 ( article A) and the other one just for 4-5 kws position 1-3 (article B). Both articles are on first google page and I want to permanent redirect the article B to A. Also on my website are some articles that point to article B and I want them to point to article A using same anchor texts. Now my question: Does this changes will pass the juice to article B to A and it will increase the article A rankings? And if I do this changes should I delete article B and reuse the content on other websites? Thank you very much for your time I will wait your answer, please excuse my bad english.

Paula Allen

Susan: There are no guarantees, but your plan seems basically sound. The 301 will preserve existing link equity. But consider whether the two pages are currently acting as support pages for each other (linked and with unique but closely related content). If so, they form a sort of mini-silo, and the surviving page’s rankings might suffer if you remove its support page. Also, any time you want to remove a page that is ranking, try to make sure that the page you’re redirecting it to can answer the same questions. I hope that helps.

its crazy to think how 301 redirects could impact your SEO efforts.

This blog really helped me out in placing redirect 301 on its place. Everything has been explained really well.

Very informative. this blog helps us to make a better understanding of how can we redirect 301 . thanks for the post.

Awesome easy guide ! A newbie can understand that very well .Thanks for the post !

301 redirects have a lot of uses when it comes to SEO. Use them strategically and you could see huge gains in organic traffic. However, it pays to make sure there are no existing problems with 301 redirects on your website first, as these could be hindering your current and future SEO efforts.

How to do a 301 Redirect is really most important when you don’t want to lose your website traffic. Really appreciate your efforts in writing this and sharing with us.

I really appreciate your efforts in writing and explaining the implementation of 301 redirect. It is really helpful for all the SEO experts.

301 and 302 re best SEO practices. whenever we want to temporary down a page we need to use 302 redirects. If you use these redirects in a wrong way then you can loss your website seo, so always make sure and double check when using these redirects.

Found the solution,After struggling redirection issues


How about if we do a redirect on Domain server level – i.e. like if you check Namecheap they give you option do you want to move domain (old URL) to a new URL

Paula Allen

Drone Master: If you do a redirect on the server level like the example given with Namecheap, then you will use their tools to set it up and the host (Namecheap) will do this for you. Typically, they redirect ALL URLs to the new site, so if you want some customization then this probably isn’t the best way to go.

Thanks, I had no idea how a 301 was done on a windows server :) Always done in .htacces, the first time I had a Windows server I didn’t know how to insert the rules :)

Paula Allen

Teamgorilla, we’re happy to help.

Thx Bruce,
For last couple of days I was having difficulty for 301 Redirect code.
You gave many examples and thx to all those made comments.

Paula Allen

Hi Riya – We’re so glad this article helped you work out your redirects. Thanks for letting us know!

It really bugs me that I have let so much good juice go to watse by not properly editing the 301 re-directs. But at least now I have a good grasp of what is required – thanks for this – even if I was a little late in picking it up!@


This is a great post. Properly 301 redirecting is very important. Especially in 2016.


I would like to move one language version (in this case english version) of the multilingual site to the new domain but, on the new domain would like to use different URLs for some old pages.
Is it possible to do it like that and what would be the step by step guide?

Best regards in advance for a help.

Hey Virginia,

Wow! apart from redirection, I was looking into LocaliseJS or something – which was obviously prooving to be too expensive!

Had never considered the hreflang option, as I wasn’t even aware of it!

Thanks for the helpful suggestion :)


Local searches will include keywords and phrases that relate to the businesses within their neighborhood,

I would like to say 301 redirection can seems like a bit of a “double-edged” knife. It does sometimes take a while for the search engines to attribute your new page with the search authority of your original page. All depends on how often your new redirected page is crawled by any search engines. Moreover, it takes too much time if you have many pages. Why not just simply by adding rel canonical attribute instead of 301 redirection?

Great article. Gonna use this as a good resource page to the challenge I’m facing.

Currently I’m doing SEO for a company that wants to rank in multiple countries. To ensure that they’ve a better user experience, they’ve hired translators to re-write their content for each individual country in their native language.

But this has created a complexity for SEO on the website as they’ve multiple URLs, with varying languages, for the same product.

So the amount of SEO that needs to be done has been multiplied.

I was looking at what could be done in a case like this, and thought that redesigning the website would be the best way to go. And redesigning it, and at the same time, doing a 301 redirect to a single page, from all the separate country/language pages.

However, it is a compromise from providing a better UX, because of the local language factor – especially in places like Russia and Japan (as told by the client).

Virginia Nussey

Hi Apurv. Multi-language sites do have many levels of complexity! I’m pretty sure redirection is NOT what you need, however. Look into hreflang. Here’s where you can start:

I don’t use 301 redirects but after reading this article I already have a plan.This is a great article. As always, chock full of great info and visuals. Thanks!

Good and easy to use, but the modern site owners choose a CMS that makes easier the 301 redirect, like WordPress with many plugins.

Great article I’ve always struggled with the proper way to do a 301 redirect, nice to have this resource hand thanks!

Easy-to-implement feature which is a blessing for your seo!

Great guide. I have to implement 301 on my site which too many 404 pages. I hosted on a windows server and now I want to do 301 HTML meta redirect. What is the best method to redirect 900+ pages using HTML redirect? And How to implement the same? Thank you.

Hi Great Post. I´ve made a huge analysis of my website and decided to start a 301 redirect project. I´ve catalogue all pages that need to change permalinks , for SEO strategy,and implemented the redirects.
In fact i´ve used a wordpress plugin called “Redirection” that manages modification pages and 404 erros too. After the whole redirection work , i sent a new sitemap to Google, and excluded the old one from Google webmaster tool.
Now, after 20 days i can see that my new pages are indexed but the old ones are still there too, resulting in a lot of duplicate titles and contents in Google Webmaster Tool HTML Improvement report
How to prevent that? or fix it?

Virginia Nussey

Hi Leo, thanks for your question. Our recommendation (hat tip BCI Director of Software Development, Aaron Landerkin) is to follow these steps:

1. Verify that those redirects from the old URLs are actually 301s using a server header checker. (Here’s our free tool that does this 302s and other methods of redirection won’t remove the old URLs. The plugin you mentioned allows you to do multiple types of redirects, so we want to make sure they are correct. If they aren’t 301s, fix the redirects so that they are 301s.

2. If the redirects are all 301 redirects, you can try submitting the old URLs back into Google so that they’ll crawl the 301. It could be that the crawl budget for the site is low, and Google may be taking its sweet time getting to all the old and the new pages – it has to crawl both, not just the new ones. Eventually, the old pages will drop out; resubmitting the old URLs may just help that process go faster.

If you give this a try, let us know how it goes!

With WordPress, YOAST which is the most popularly used SEO plugin now includes redirect functionality that makes it super easy. You can also do this through your cPanel but hats off to anyone that can do complex redirects using regex.

Thanks so much for detailed article on redirects.

“As long as everything is done correctly, a 301 redirect will ensure that you keep the rankings earned by the old page and prevent duplicate content that could arise if the engines were to index both versions of your site.” This is so true.

Having applied it to a few sites it has helped to flow over all the benefits from previous sites no longer live.

This is absolutely priceless info. Thank You So Much!!!

Wonderful explanations. Possibly another point to cover here would have been doing redirects in WordPress … Mainly because it is one of the most used today. For any that are seeking info on that … Most seo plugins do allow for this in WP. If the one you use does not just look for a redirect plugin and be sure to use 301 redirects for permanent redirects (they are the kind that matter for seo).

Problem solved. Thxs to

You have to do a rewrite:

RewriteEngine on
Redirect 301 /

Simple htaccess redirect is not sufficient.

Thank you Christi,

to put it into more detail: let´s say, points a link to your site That is a backlink that get from used to use worpress, or php but decided implement a design change and go with html. so what would be the redirect code from the to

Note that the redirect should be working from (this exact path).


There is plenty of information 301 redirects and on how to set them up for your website.

Most of the answers deal with the redirects between the same files paths.

There is less information on how to redirect backlinks properly that point to your domain, but to a different url structure and different file paths, file extensions.

Please share your experience.

One frequent question was: How do I redirect backlinks that from a WordPress or php site to an HTML site (same domain !!). This issues occurs when you change design on a website.

Thanking you in advance for your contributions.

Hi Sandra,

Well, you can’t redirect backlinks, since they are controlled by external domains that you don’t control. A 301 redirect from “Page A” to “Page B” instructs search engines take the known backlinks to “Page A” and reattribute them to “Page B.”

Hope that helps!

Hi Bruce,

Thank you for the wonderful article.

How to fix .htm 404 errors? Any help would be greatly appreciated.

That’s a pretty broad question — can you tell us more about what’s broken?

301 and 302 always confuse me when implementing.

These are different status codes. Each one has a different meaning. 301 means a permanent redirect, while a 302 means that the document for the requested URL was found at another URL. Hope that helps!


Great insight about 301 redirection. You have nicely explained about implementation of 301 redirect.

Keep Posting.

Great read! Very informative and detailed article. Very useful when having some site revamps.

Nice post. When implementing 301’s, canonical tags should be considered too!


I am bringing in in a new website and plan on setting up 301 redirects in the .htaccess file.

Do I need to keep the OLD .html pages on the server?

Susan Esparza

@Chris – There’s no reason to keep the pages on the server once you’ve put in a redirect. However, it’s always smart to keep a backup of your pages somewhere. You never know when you’ll need that information again.

the .htaccess file always gives me fits. This helps. Although I usually have help with stuff like this. But I think with this guide I can now do it myself!

It’s fantastic that have referred to a topic that rarely discusses. 404 errors are one of the worst obstacles to their search engine rankings and are not taken well by the SE. You need to have a proper 301 redirect procedure in place, especially if you constantly add and remove pages from your website.

Great guide, really good described. I have just implemented it on my site which runs on apache box and it worked. better safe than sorry and not get kicked out because of dublicate content :)

Awesome easy guide ! A newbie can understand that very well .Thanks for the post !

Thanks for the clarification on this issue. It seems to be something that isn’t going to go away and we need to make sure we address it.

If you ever have trouble trying to do a redirect and set a cookie as part of the same response, if your using IIS 5.0, the problem might be caused by an IIS bug.;en-us;q176113

It seems as if IIS filters out the cookies. If you are trying to redirect to an application server, you might try redirecting directly instead of going through the web server.

It’s great that you have touched upon a subject that is rarely discussed about. 404 errors are one of the worst impediments to your search engine rankings and are not taken well by SEs. You need to have a proper 301 redirect procedure in place, especially if you constantly add and remove pages to your website.


I have some problems with the 301 redirect. I need to redirect /index.php?/archives/old-url.html to /archives/new-url.html. I tried with Redirect 301 /index.php?/archives/old-url.html /archives/new-url.html but for soem reason it didn’t work :( any suggestions?

If I want to redirect a one domain to another, is there a difference between a 301 redirect and a permanent redirect? or are they the same thing?

Starr McCaffery

Wow, this is the most informative article and string of comments I’ve found in about 3 weeks of searching. I have an old site created by someone else that I am taking down but want to do a basic/minimal hosting to redirect the domain (which I own) and pages to the new site. Old site has .asp pages. New site used a site builder that won’t allow me the various folders, sub-folders and long page name structure of old site. I understand how to redirect the old pages to the new corresponding but slightly mis-matched page names with an asp redirect. My problem is I don’t have IIS access and don’t know how to redirect the domain itself (there are links out there that I’m trying to change over but that takes time) without IIS access. My instruction on asp redirect says insert code and save as oldpagename.asp. But my domain isn’t a page name. Any advice? First I tried to set up hosing for the old domain on Linux and do .htaccess and that works for the domain, but with the asp pages it doesn’t so I need to switch it to Windows. Is there a Windows-compatible file, like an .htaccess, that I can use for the domain? Thank you.


I wanna know if you had an opinion on what I should do about the permanent redirect for an ASP Site . I cannot do it with my index page having an html extension. Should I change my homepage to extension .asp? That’s the only way I think I can do it.

Great article! What if i don’t have IIS admin access and only using .htm pages?

what should i do?

Jim Glockner

We are incorporating a 301 redirect in our dev/uat environment before we move this to production as a proof of concept. This environment is not accessible via the DMZ therefore I cannot test accuracy to ensure the 301 header is displaying correctly via the many tests that are offered out there by inserting the domain into a textbox and returning a "http / https Header Check". Are there any ways I can test this internally?
Can you pls respond.
Thank you
Jim Glockner
Webmaster Deluxe Corporation

I am not aware of an .htaccess file for use on an IIS server but there are native functions in IIS to do everything you need to do.

The limitations are scalability for a large site but if you cannot manage it at the server level you may have to consider doing it at the file level.

I am trying to get a nonwww to www redirect when people come to my site. How do I correctly get the ISS redirect to work. I went into ISS, followed ALL instructions and it still wont redirect my site to www if someone enters it without www. ANy ideas?

Hi maybe you can help
About 3 days ago i done a 301 direct from my old domain to new domain.
Both sites are now indexed with google for the same key phrases, how long before the old domain goes from index. or will they punish me for dup content.

John Sisler

Hi Allison, I am not aware of an .htaccess file for use on an IIS server but there are native functions in IIS to do everything you need to do.

If you are running an apache server and you do not have access to the .htaccess file there is another method to redirect which is to code the redirect in the pages. The limitations are scalability for a large site but if you cannot manage it at the server level you may have to consider doing it at the file level.

There is a pretty compreshensive page on doing this with different scripts (java, vb, php) at


A couple questions:
1) I’ve heard about software that is coming out that allows you to implement an .htaccess file on an IIS server. Does anyone have more info on this or know where I could learn more about this?
2) You mention the following, “The ability to use .htaccess files will reside in a command called “Allow Override” in the Apache Configuration file.” How do I find the Apache Configuration file? Is it typically named the same thing and found in the root, or elsewhere? Can I find it if I have FTP access? And if I have my FTP client setup to view hidden files and I don’t see an .htaccess, is it always safe to upload one? I have a client who is on an Apache server, but I don’t see an .htaccess file. However, the site redirects to the home page if there is a 404 error. I thought the only way to do this on Apache was in the .htaccess but I can’t find the file. Is there something I’m missing?

Bruce clay: I did a 301 redirect, but I’m having some major issues. I was in the top 5 for website design and great traffic, I did the 301 about 1 week ago and now our traffic has dropped and no calls from google for like 1 week now. which I just did the 301 redirect 1 week ago

now my keyword is in positions 500-600 was number 4, how long does it take things to level out and get my traffic and rankings back? My headers tags are reading 301 and I implemented it correctly?

It counts as a 302 redirect.
With a 200 OK on both the start and target page, the search engine index both the start page and the target page.
Since this method is a known spam method, it is best to avoid it.


Samantha, if you can’t use htaccess and do a 301 redirect, then you could do a meta-refresh as long as the time period is under 1 second. However, can someone please verify that the meta-refresh counts as 301 and not a 302 redirect.


Thx Bruce,
For last couple of days I was having difficulty for 301 Redirect code.
You gave many examples and thx to all those made comments.


Thanks for the post. Is there any suggestion on how to handle a situation where a URL needs to be redirected to an “SEO friendly” one. TLD remains the same.

Old URL:
corresponding new URL:

I would assume in the absence of 301 redirects, there will be 2 differently formatted URLs indexed and it’s unclear what the impact on the page rankings will be


ok, so let’s say you’re in the unfortunate situation where you’re unable to do either. you’re unable do htaccess or a 301 through windows server and you have to edit each page by hand.
what would you do to change the response code and then add it to the header? what would that code look like? is there an example for that?
i know i could google it, but i have done that before and the results that i found didn’t work correctly.


Nevermind, I’ve figured it out. I wrote a series of four conditionals in the .htaccess file that redirect appropriately based on what URL is requested.

Basically it just redirects all pages on the old domain to the new one AND redirects ‘non-www’ URLs to their ‘www’ counterparts.

I’ll put up my code for anyone to be able to dissect and use based on their requirements.

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^ [nc]
rewriterule ^(.*)$$1 [r=301,nc]

rewritecond %{http_host} ^ [nc]
rewriterule ^(.*)$$1 [r=301,nc]

rewritecond %{http_host} ^ [nc]
rewriterule ^(.*)$$1 [r=301,nc]

rewritecond %{http_host} ^ [nc]
rewriterule ^(.*)$$1 [r=301,nc]

rewritecond %{http_host} ^ [nc]
rewriterule ^(.*)$$1 [r=301,nc]

*Note: the “/” behind any domain name on a condition line takes whatever page off of the domain name in the URL was requested and sends it to the page of the same filename on the new domain (I the “$1” variable asks the server to retain the filename from the request).


Thanks for the great article.
What if you’ve got to two servers on the same shared hosting?
and you want to
a)redirect non-www domain of the new domain to its ‘www’ counterpart (e.g. ->
b)and redirect any requests to the domain to
Is this possible even though both sites are working off of the same .htaccess file (because of the shared hosting situation)?
Can I modify each “.htm” file of the old site to point to its new counterpart (e.g. -> even though they are HTML files and not in PHP, ASP or Java?

Thanks for the detailed & thoughtful answers.


Woah, Dave. Easy with the geek speak! You’ll hurt a girl with all those slashes, brackets and fancy words! I’m not going to lie, most of these questions were completely over my pretty little head, so I trotted myself down to our IT department, locked my favorite geek in a room, and fired them at him. Here’s what he had to say:

1. My guess is that they don’t have a problem with both of them being indexed in Google, thus creating duplicate content. I think when you are the search engine, you probably aren’t violating any guidelines.

2. If you are using Apache, then you can modify the .htaccess file on the site with the OLD URL to say:

RedirectPermanent /oldpage.asp

If you are using Windows Server, then you can browse to the file in the IIS Panel, right-click and hit properties. Instead of looking for the “Home Directory” tab, look for the “File” tab, and you can select the permanent redirection there.

Or, if you don’t have access to these things, you can place this ASP code at the VERY TOP of oldpage.asp:

3. Yes…kind of. If they are all redirecting to the same place, then the redirects above should work. If you want to redirect each one to a different place, it would be best to do a Mod Rewrite in Apache in order to 301 redirect them.

In IIS, it is MUCH harder where you would need to have different sites defined for www. and non-www. in your panel and redirect those. For IIS, it would be much faster, simpler, easier, etc. to put ASP code on the pages or use an ISAPI Rewrite Module to redirect each different variation to a different location.

4. Don’t use a redirect.
Instead, make index-d.html your default page that loads when is requested. To do this in Apache, add this line to your

DirectoryIndex index-d.html index.html index.htm

This defines index-d.html as being the first page that the server looks for on a directory request. If it can’t find that page, then it will go to index.html and so on.

On a Windows Server, go to IIS, right-click on the web site or the directory and click Properties. Once there, click on the “Documents” tab. Then make sure that “Enable Default Document” is checked and add your new filename into the list. Then, move the new document name to the top of the list.

5. I’m not sure what you’re asking here. If you don’t want a file to be indexed, then yes, use the robots.txt file to exclude it.

Great post!

So… Why does Google use a 302 redirect to go from: – to –
Why doesn’t Google use a 301?

What if you want to redirect internal pages with a 301?

http://www.oldurl[dot]com/oldpage.asp – to – http://www.newurl[dot]com/newpage.asp (Easy enough)

But… What if there are several variations of the old URL caused by the URL prefix?

www & http:// & http://www & https:// – https://www – Would that require more than one redirect?

What sort of redirect should you use if you have a new content management system and need to go from something like: http://www.coca-cola[dot]com – to – http://www.coca-cola[dot]com/index-d.html

Should you use the robots.txt file to Disallow the URL with the extra characters via? http://www.coca-cola[dot]com/robots.txt



Your email address will not be published.

Serving North America based in the Los Angeles Metropolitan Area
Bruce Clay, Inc. | PO Box 1338 | Moorpark CA, 93020
Voice: 1-805-517-1900 | Toll Free: 1-866-517-1900 | Fax: 1-805-517-1919