301 Directive is a Redirect that informs the client an item is permanently moved. Good for googlebot and such, as Google will update the link to the document.
Use a mod_rewrite directive in an .htaccess file. Let's say you wanna move everything from
http://www.somedomain.tld/2006/17/34/page.htm to
http://www.somedomain.tld/page34.htm:CODE
RewriteEngine On
RewriteRule ^2006/17/34/page.htm /page34.htm [R=301,L]
That'll do it. For a large number of pages, it's often beneficial to use RewriteMap or something ... take a look at the
Doc pages on Apache.org for more info (pretty much the same for 1.3 or 2.0)