Tuesday, October 02, 2007

Q and A: How do I implement 301 redirects for individual pages?

Dear Kalena...

We are re-designing our web site and about 20 percent of our pages will be moved from their existing file locations. I have been reading on your site about using 301s to achieve this. We are planning to use a 301. But instead of using it in an .htaccess file we are going to include it within the HTML code of individual pages before the header. I know of no other way to do it except in meta form. If we do it in .htacces then won't it redirect all of our website? Is that ok or do you recommend using them in another way? Do you have specific instructions that you recommend for using them?

Chris

Kalena's Answer:

Dear Chris

Don't ever use META Redirects! In my experience, they are the kiss of death as far as search engines go. If your whole domain was moving, you could use mod_rewrite, but as you only need to redirect certain pages, you'll need to use 301s in your .htaccess file. The way to do this is as follows:

1) Add this line to your .htaccess file:
Redirect permanent /oldpage.html http://www.mydomain.com/newpage.html

You'll need to replace mydomain.com with your actual domain name so when the visitor types in http://www.mydomain.com/myoldpage.html, they will be automatically redirected to http://www.mydomain.com/mynewpage.html.

2) If you've renamed an entire directory, you can use one redirect line to affect all pages within the directory:
Redirect permanent /olddirectory http://www.mydomain.com/newdirectory/

Note that the old page or directory is specified using the system path relative to your www directory, while the new page or directory is specified by the absolute URL.

This online tutorial takes you through the method step-by-step. There is another .htaccess tutorial here if you prefer it. Some hosting control panels allow you to do this via a simple interface titled "redirects" where you type in each URL to be moved and the URL where you want it redirected to.

Google has made one or two posts that confirm that 301s via .htaccess are their preferred method for informing Googlebot that your page location has changed, so I highly recommend you take their advice.


Need more than advice? Take a Search Engine Marketing course online

Subscribe via: Yahoo Feeds | Feedburner | Technorati | Bloglines

Labels:

AddThis Social Bookmark Button

1 Comments:

At 2:10 PM , Webnauts said...

If a hosting company does not provide a site owner the rights to edit an .htaccess file, or does not support server side scripting, how can a site owner deal with that? The only way I am aware of is using that meta tag setting the value to "0". Or do you see another way?

 

Post a Comment

<< Home


Proposal templates ready for editing