A 301 redirect is the canonical way to permanently move a URL. The server responds with status 301 Moved Permanently and a Location: header pointing at the new URL. Browsers follow the redirect transparently; search engines transfer the original URL's link equity (PageRank, backlinks) to the destination over time.
Common configurations:
- nginx:
return 301 https://newhost.com$request_uri; - Apache .htaccess:
Redirect permanent /old /new - Cloudflare Page Rules / Workers
- Vercel/Netlify: a
_redirectsfile orredirectsconfig
301 vs 302: a 301 is permanent (search engines update their index, equity flows to the destination); a 302 is temporary (search engines keep indexing the old URL). Use 301 for site moves, URL restructures, and HTTPS upgrades. Use 302 only for short-lived A/B tests or maintenance pages.
Avoid redirect chains -- each hop adds latency and erodes equity. Audit periodically with a tool like Screaming Frog or our own /tools/redirects checker.