views:

137

answers:

3

I'm managing an established site which is currently in the process of being upgraded (completely replaced anew), but I'm worried that I'll lose all my Google indexing (that is, there will be a lot of pages in Google's index which won't exist in that place any more).

The last time I upgraded a (different) site, someone told me I should have done something so that my SEO isn't adversely affected. The problem is, I can't remember what that something was.


Update for some clarification: Basically I'm looking for some way to map the old paths to the new ones. For example:

  • User searches for "awesome page"
  • Google returns mysite.com/old_awesome_page.php, user clicks it.
  • My site takes them to mysite.com/new_awesome_page.php

And when Google gets around to crawling the site again...

  • Google crawls my site, refreshing the existing indexes.
  • Requests old_awesome_page.php
  • My site tells Google that the page has now moved to new_awesome_page.php.

There won't be a simple 1:1 mapping like that, it'll be more like (old) index.php?page=awesome --> (new) index.php/pages/awesome, so I can't just replace the contents of the existing files with redirects.

I'm using PHP on Apache

+2  A: 

You can tune Google's view of your site, and probably notify its changes, from within Google Webmaster Tools. I think you should build a sitemap of your current site, and have it verified when the site changes.

Federico Ramponi
While having an updated site map is good, I don't think it solves his problem of having a previously indexed page that is changing. Let me know if it actually does though.
Micky McQuade
A sitemap simply helps keep search engines informed of new URLs.
Liam
+4  A: 

301 redirect all your old (gone) pages to the new ones.

Edit: Here's a link to help. It has a few links to other places too.

dylanfm
yeah, i was kinda wondering *how* to do that.
nickf
I use IIS, but I think this is how in your .htaccess file:redirect 301 /old/old.htm http://www.you.com/new.htm
Micky McQuade
+3  A: 

You need to put some rewrite rules in an .htaccess file.

You can find lots of good information here. It's for Apache 1.3, but it works for Apache 2, too.

From that article, a sample for redirecting to files that have moved directories:

RewriteEngine on
RewriteRule   ^/~(.+)  http://newserver/~$1  [R,L]

This reads:

  • Turn on the rewrite engine.
  • For anything that starts with /~, followed by one or more of "anything", rewrite it to http://newserver/~ followed by that "anything".
  • The [L] means that the rewriting should stop after this rule.

There are additional directives that you can use to set a [301] redirect

You could do:

RewriteEngine on
RewriteRule   old_page.php  new_page.php  [L]

But you'd have to have a rule for every page. To avoid this, I'd look at using Regular Expressions, as in the first example.

majelbstoat