Permanent vs. temporary redirects
Google sorts redirects into two families. Permanent: 301 and 308 status codes, an instant meta refresh and, as a last resort, a JavaScript redirect. Temporary: 302, 303 and 307 codes and delayed meta refreshes. With a permanent redirect, the target becomes the canonical URL and the old address gradually drops out of results; with a temporary one, the original page stays in Google.
When to use a 301
- A site redesign or a new URL structure.
- A move to a new domain name.
- Switching from http to https, or unifying www and non-www versions.
- Merging two pages that were cannibalizing each other.
- Deleting a page that has backlinks when an equivalent page exists.
Best practices
Redirect each old URL to its closest equivalent, one by one, rather than everything to the homepage: Google may treat a redirect to an unrelated page as a soft 404. Avoid chains (A to B to C) and loops, update internal links to point straight at the final URL, and keep redirects in place for years, since backlinks, bookmarks and old emails will keep pointing at the old addresses.
Setting up a redirect
On Apache, one Redirect 301 line in the .htaccess file does it; Nginx uses a return 301 directive. WordPress has plugins such as Redirection, and Shopify a built-in URL redirects menu. In Next.js, a redirect marked permanent returns a 308, which Google treats like a 301. Check the result with a tool that shows the status code and the full redirect chain, and spot-check a sample in Search Console's URL Inspection tool a few weeks later.
