301 redirect
Google's redirects documentation groups 301 and 308 as permanent redirects, which tell its indexing systems that the target should replace the old address. Temporary redirects such as 302 and 307 keep the old address in results, so they are the wrong tool when a page has moved for good. JavaScript redirects are a last resort, because Google may not see them.
The everyday case is a rebuild. If a factory's old page for Fe 500D TMT bars moves from a .html address to a new folder path, a 301 from old to new keeps the Google result, dealer links and directory listings working. Without it, every one of them leads to an error page. Each old URL should point straight to its closest new equivalent, not to the homepage, and the redirects should stay in place for at least a year after the site migration is finished.