+1  A: 

301 is definitely the correct route to go down to preserve your page rank.

Alternatively, you could catch 404 errors and redirect either to a "This content has moved" type page, or your home page. If you do this I would still recommend cherry picking busy pages and important content and setting up 301s for these - then you can preserve PR on your most important content, and deal gracefully with the rest of the dead links...

Paul
The best answer to the question as asked because it doesn't make assumptions about the tools available...
Murph
+3  A: 

301 is an excellent idea. Consider you can take advantage of global configurations to map a group of pages. You don't necessary need to write one redirect for every 404.

For example, if you removed the http://example/foo folder, using Apache you can write the following configuration

 RedirectMatch 301 ^/foo/(.*)$ http://example.org/

to catch all 404 generated from the removed folder.

Also, consider to redirect selectively. You can use Google Webmaster Tools to check which 404 URI are receiving the highest number inbound links and create a redirect configuration only for those. Chances are the number of redirection rules you need to create will decrease drastically.

Simone Carletti
+1  A: 

I agree with the other posts - using mod_rewrite you can remap URLs and return 301s. Note - it's possible to call an external program or database with mod_rewrite - so there's a lot you can do there.

If your new and old site don't follow any remapable pattern, then I suggest you make your 404 page as useful as possible. Google has a widget which will suggest the page the user is probably looking for. This works well once Google has spidered your new site.

brianegge
+1 for the google widget - handy little thing!
Paul
A: 

Along with the other 301 suggestions, you could also split the requested url string into a search string routing to your default search page (if you have one) passing those parameters automatically to the search.

For example, if someone tries to visit http://example.com/2009/01/new-years-was-a-blast, this would route to your search page and automatically search for "new years was a blast" returning the best result for those key words and hopefully your most relevant article.

xkingpin