Troubleshooting guide · http-status · Published 2026-08-15 · 4 min read
HTTP 301 redirects that preserve rankings
HTTP 301 redirect guide: when a 301 preserves rankings, how to write the server rule, and how to verify old URLs resolve to the new page.
- ·What a 301 is
- ·301 vs 307 table
- ·Fix order
What a 301 redirect is
A 301 moved permanently tells a browser, a crawler, and the search engine index that the requested URL has a new permanent home. The client follows the Location header automatically. Search engines treat a real 301 as a transfer of signals: the link equity, anchor text, and crawl history of the old URL move over to the target. That is why "quick fix" redirect practices with meta refresh or JavaScript matter here: they carry no status signal at all.
When a 301 is the right code
Use a 301 when the old URL is gone forever and the new URL is the replacement the old one should point to. The typical cases are a slug change, a domain or subdomain move, a protocol or host change, merging old category pages, or replacing a removed product with its closest live equivalent.
Use a temporary code (302 or 307) when the landing URL will return later, for example an A/B test that must revert after the test, a short promotional takeover, or a holiday banner that does not own the page long term.
| Situation | Correct status | Why |
|---|---|---|
| Permanent slug change after a rewrite | 301 | The old path is dead forever |
| A/B test split for a few days | 302 or 307 | The swap must revert |
| Promotion on a URL that stays live | 302 or 307 | The default page must return |
Does a 301 really preserve rankings
With care, yes, and for two reasons. First, crawlers stop requesting the old URL once they see the redirect, so the old page stops being a separately crawled candidate. Second, the equity ports to the new URL, so the destination page inherits the ranking signals instead of starting from zero. The catch is that the target must be a real, related page returning 200. A 301 to the home page from every dead URL dilutes relevance, and a 301 chain (301 to 301 to 301) works but adds latency and small risk each hop you can audit.
How to fix (ordered)
- Build the redirect map outside the server. Column A is every old URL you can find, column B is the single best target for each. Use up to one target per old URL, and never let one old URL point to two places.
- Implement the map at the server layer, not in the HTML. On Apache add rules in
.htaccessor the virtual host. On nginx addreturn 301blocks. On Cloudflare use a Bulk Redirect. Examples below. - Test outside the CMS. Run
curland check the status andLocationheader. - Confirm the target itself answers 200, then let the mapping propagate to the browser cache that stores it.
- Update internal links so the canonical path is the new URL, and re-request the old URL in Search Console or Bing Webmaster Tools.
# Apache, per old path
Redirect 301 /old-seo-page/ /new-page-url/
# nginx
location = /old-seo-page/ {
return 301 /new-page-url/;
}
How to verify
curl -I https://example.com/old-page/- Read the HTTP status line. It must be
301and the Location must be the exact new URL. - Check the target returns
200, not301again or a redirect to a third URL.
Prevention
- Keep the map in source control by timestamp so the rules are part of the deploy.
- Test the full move once in staging before production, including
httptohttpsand thewwwvs bare host variants. - Do not stack more than two hops on one path.
- Do not point old URLs at a random 404 or the homepage unless there is genuinely no better target.
A 301 with a good map and readable rules is the highest fidelity way to keep the work the old page has built.