SEO Fundamentals

How to Set Up Redirects When You Change or Remove a URL

How to set up redirects that actually help: 301 vs 302, when a 410 beats a redirect, why chains cost you, and how to verify every hop with curl.

S SparkCliks 0 25 min read
Share
How to Set Up Redirects When You Change or Remove a URL

Most guides show you how to set up redirects and skip the harder half, which is deciding whether the old URL deserves one at all. Sending every dead page to the homepage is the popular version of that mistake, and Google's site move documentation says it "might be treated as a soft 404 error", so it helps the searcher roughly as much as it helps you. This post runs the decision first, then the mechanics: 301 against 302, when a 410 is the honest answer, what each hop in a chain actually costs, and how to prove with curl and Search Console that the redirect does what you think it does.

The Decision Tree to Run Before You Set Up Redirects

A redirect is a claim. It says: the thing you asked for lives here now. Every bad redirect is that claim being false, and no amount of correct server configuration repairs a false claim.

So before you touch a config file, answer three questions about the old URL.

  1. Does the thing that URL was about still exist somewhere on this site?
  2. Would a person who clicked the old link recognize the destination as the answer to what they clicked?
  3. Is the removal permanent, or does this URL come back?

Question two decides most cases, and it is the one almost nobody asks. If the honest answer is no, you do not have a redirect problem. You have a removed page, and there are better tools for that.

The situationWhat to sendWhy
Same content, new address (rename, restructure, HTTPS, domain move)301Permanent, and a strong signal about which URL is canonical
Content merged into a bigger, better page301 to the merged pageThe destination genuinely answers the same need
Product discontinued, close replacement exists301 to the replacement or its categoryThe intent survives even though the page did not
Page pulled temporarily and returning at this address302You want the original URL to stay the indexed one
Whole site down for maintenance503 with `Retry-After`, not a redirectA redirect claims the URL moved, which is not true
Content removed, nothing on the site serves that intent410, with a helpful page bodyHonest, and it stops the guessing
Content removed, but the demand behind it is realBuild a page for it, then 301 the old URL to itA redirect is not a content strategy
Both URLs need to stay reachable by people`rel="canonical"`, not a redirectA redirect removes access to one of them

Count the rows. Four of the eight are a 301, and that ratio is already more generous than most sites deserve. If your redirect map is 100 percent 301s pointing at three destinations, it was not built from a decision. It was built from a default.

What Each Status Code Actually Tells a Crawler

The status code is the whole message. Everything else is your server's opinion.

CodeNameWhat Google's crawler documentation saysOriginal request method preserved
301Moved Permanently"a **strong** signal that the redirect target should be processed"Not guaranteed, may be rewritten to GET
308Permanent Redirect"Equivalent to `301`"Yes
302Found"a **weak** signal that the redirect target should be processed"Not guaranteed, may be rewritten to GET
307Temporary Redirect"Equivalent to `302`"Yes
303See OtherClassed as a temporary redirectNo, forces GET

The method column matters for APIs and form submissions, not for a page somebody reaches from a results page. That request is a GET either way. For URL changes on a content site, 301 and 308 are interchangeable, and 301 is what nearly every server, CDN and CMS gives you by default. Take the default.

Two other kinds of redirect exist and both are worse. A meta refresh in the page head is read as permanent when it is instant and as temporary when it is delayed, but the engine has to fetch and parse a whole HTML document to find a routing decision a response header could have carried on the first byte. A JavaScript redirect is worse again. Google's redirect documentation is blunt: "Only use JavaScript redirects if you can't do server-side or meta refresh redirects", warning that if rendering fails, "Google might never see it". You would be making a routing instruction depend on a render pass that is queued, deferred and occasionally skipped.

Free trial

Stuck on page two?

Real human clicks that lift your CTR and move you up the rankings.

301 vs 302: When Each One Is Genuinely Correct

"Always use 301" is advice that is right most of the time and expensive in the cases where it is wrong.

301 (permanent)302 (temporary)
What it claimsThis URL has moved for goodThis URL is fine, it is just serving from elsewhere right now
Effect on canonicalizationStrong signal that the target should be processedWeak signal, the original URL tends to stay canonical
Browser cachingCached aggressively, often until the user clears their cacheNot cached by default
Cost of using it wronglyHigh, and it lingers in browsers after you fix the serverLow, and it clears the moment you remove the rule
Use it forRenames, restructures, HTTP to HTTPS, www consolidation, domain moves, retiring duplicatesSplit tests, out of stock products returning, short campaign URLs, geo routing where both destinations stay indexable

The browser caching row is the one that bites teams. A 301 deployed by mistake keeps firing for returning visitors long after you have reverted the rule, because their browser never asks your server again. A wrong 302 is a config bug you fix in five minutes. A wrong 301 is a config bug plus a support queue.

Genuine 302 cases are narrow but real:

  • A split test that routes some visitors to a variant URL. The test ends in three weeks. A 301 there tells the indexing pipeline to treat the variant as the canonical version of the page, which is precisely the outcome you do not want.
  • A product that is out of stock and coming back. The URL is not dead. Keep it, keep it indexed, and say on the page when it returns.
  • A short campaign URL repointed each quarter. /offer/ is a permanent address whose destination is temporary.
  • Language or region routing on a root URL where the regional pages must each stay independently indexable.

Everything else on a normal site is a 301.

When Not to Redirect at All

Here is the sentence most redirect guides never quote, from Google's site move documentation:

"Don't redirect many old URLs to one irrelevant single URL destination, such as the home page of the new site. This can confuse users and might be treated as a soft 404 error."

Notice where it lives. It is documented under site moves, not under redirects, which is why a guide written from the redirect page alone never mentions it.

The mechanic is simple once you see the redirect as a claim. If the destination does not answer the request the old URL answered, a system evaluating that destination can conclude the content is missing, mark it a soft 404, and drop the old URL anyway. You get every downside of the removal, plus visitors who land somewhere confusing and go straight back to the results page.

Destination quality is a spectrum, not a yes or no:

Old pageProposed destinationVerdict
Discontinued "14 inch blue widget"The blue widgets category pageFine. The intent is still served
Discontinued "14 inch blue widget"The homepageSoft 404 risk. Nothing there answers the query
A retired guide on a topicThe updated guide on that topicThe ideal case, and the reason redirects exist
A retired guide on a topicThe blog indexWeak. Index pages rarely answer a specific query
A recurring annual event pageThis year's event pageReasonable, the audience and intent carry over
A one time event page410Nothing equivalent exists and nothing ever will
An entire retired `/category/` treeOne new landing pageOnly if that page genuinely covers the whole tree
An unrelated domain bought at auctionAnywhere on your siteNot a maintenance decision. Search engine spam policies cover this

The two blue widget rows are the useful pair. Same removal, same site, two destinations, and the only difference is whether a person arriving there would feel answered or dumped.

When 410 Is the Honest Answer

There is a widely repeated claim that a 410 deletes a URL from the index faster than a 404. Check the current documentation before you plan around it. Google's guidance on how status codes affect its crawlers groups them together: "All 4xx errors, except 429, are treated the same", and it states that URLs already indexed that return a 4xx status "are removed from the index". Individual Google representatives have described a marginal difference in the past. The published documentation does not promise one, so do not build a timeline on it.

That leaves the real reasons to use 410, none of which depend on crawler behavior:

  • It records intent for your own team. A 404 in a crawl report stays ambiguous forever: deliberate removal, or a broken route somebody needs to fix? A 410 answers that inside the response.
  • Other consumers can act on it. Link checkers, feed readers and third party crawlers can treat 410 as final and stop retrying. Many treat 404 as possibly transient, because it often is.
  • It stops the page being resurrected by accident. A 404 invites a well meaning teammate to "fix the broken link" six months from now.
For a removed pageStays in the indexWhat a visitor seesWhat your crawl report saysChoose when
301 to a relevant pageThe destination doesThe answer they wanted, at a new addressClean 3xxAn equivalent genuinely exists
301 to the homepageProbably neitherA page about your company, not their queryClean 3xx, and it looks fine, which is the trapNever
404No, it gets removedYour not found pageAmbiguous. Bug or intent?The removal is real but you have no policy
410No, it gets removedYour gone pageUnambiguous, deliberateThe removal is permanent and nothing replaces it
`noindex` on a live pageNo, once recrawledThe page, still workingClean 200The page must stay reachable but out of search
Leave it live, unchangedYesThe old pageClean 200You have not actually decided yet

Two details people get wrong here.

The body of a 404 or 410 response still matters. Return the status code, and also return a real page: a plain statement that the page is gone, a search box, and links to the two or three closest live pages. A blank error page wastes somebody who was interested enough to click.

Do not serve a helpful page with a 200 status. That is the literal definition of a soft 404: the content says error, the header says success. Search Console flags it, and you have taught your own reporting to lie to you.

If the page needs to stay reachable for people but out of search results, a redirect and a 410 are both wrong. Robots.txt versus noindex covers the tool that is actually right for that job.

Worked Example: A Removed Page That Still Gets Impressions

This case produces the most bad redirects, because the impression count feels like a reason to act fast. Here is how to work through it properly in Google Search Console.

Step 1. Get the URLs the engine is still serving. Search Console, Performance, then Search results. Set the date range to Last 3 months, open the Pages tab, and export.

Step 2. Get the URLs you actually have. Your XML sitemap is the fastest source, or run a crawl if the sitemap is not trustworthy. Submitting a sitemap and checking indexed pages covers getting that list clean.

Step 3. Subtract. Anything in the Performance export that is missing from your live list is a candidate: a URL the engine still has indexed and still shows to people, whatever your server returns for it today.

Step 4. Read the demand, not the volume. For each candidate, apply a Page filter (URLs containing that path), then switch to the Queries tab. Those queries are the actual reason the URL still surfaces.

Step 5. Decide per URL using the table in the first section.

The rule that saves you here: the decision is driven by whether those queries are still served somewhere on your site, not by the impression count. A removed URL with 4,000 monthly impressions is not an argument for redirecting it to the homepage. It is an argument for asking whether you should have a page for those queries at all.

Every figure below is an illustrative example, not SparkCliks data:

Removed URL (example)Impressions, 3 months (example)Top queries (example)Intent served elsewhere?Decision
`/guides/old-ctr-guide/`1,240"organic ctr benchmark"Yes, a newer guide covers it301 to the newer guide
`/promo/spring-2025/`310brand name plus "spring offer"No, the offer ended410
`/tools/legacy-checker/`890"free ctr checker"No, and the demand is clearly realBuild the replacement, then 301
`/tag/misc/`60scattered, no patternNot meaningfully410, and delete the internal links to it

Three different answers came out of one export. A single bulk rule could not have produced any of them.

Measuring whether the change worked

Redirects get judged on vibes far more often than on data. A design that survives review:

  • Baseline. Export 28 days of Performance data for the affected URLs before you deploy anything, and record the deploy date.
  • Control set. Pick a group of pages at similar impression volume that you deliberately do not touch. Without one, a seasonal dip reads as your redirect failing.
  • Read window. Ignore the first two weeks. Search Console cannot report a new status for an old URL until that URL is recrawled, and recrawl frequency varies per URL by a lot. Crawled but not indexed explains why that gap exists.
  • What to read. The destination URL's impressions and queries, and the old URL moving to Page with redirect in the Page indexing report. Expect a stretch where both appear. That is normal.
  • Signal threshold. A move smaller than the week to week variance of your control set is not a result. Write that variance down before you look at the treated pages, so you cannot move the bar afterwards.

What Happens to the Signals the Old URL Earned

This is where redirect advice turns into folklore, so it is worth separating what is on the record from what is not.

On the record. Google's crawler documentation describes a 301 as "a strong signal that the redirect target should be processed" and a 302 as "a weak" one. In July 2016, Gary Illyes, then a webmaster trends analyst at Google, stated publicly that 30x redirects do not lose PageRank, and John Mueller indicated at the time that this was already how the systems had been working. That is a public statement from a company representative rather than a line in the documentation, and it is about PageRank specifically.

Not on the record. Any percentage. If you have seen a claim that a 301 passes 85 or 90 or 99 percent of "link equity", none of those numbers came from a search engine. The most cited of them traces back to the damping factor in the original 1998 PageRank paper, which describes something else entirely: the probability that a modeled random surfer keeps clicking rather than jumping to a fresh page. It was never a statement about redirects, and repeating it as one is how a modeling constant became an industry fact.

Also not on the record: that rankings transfer. They do not move as a unit. The destination page is evaluated as itself, on its own content, for each query.

So what can you actually count on from a redirect?

  1. People and crawlers requesting the old URL arrive at the new one.
  2. A permanent redirect is a strong instruction about which URL should be treated as canonical, stronger than a canonical tag, which the documentation calls a hint. If those two ever disagree on your site, how canonical tags work and fail covers what happens next.
  3. Links pointing at the old URL keep resolving. They keep counting as links to your site rather than links to an error.

What you cannot count on is that the destination will rank for the old page's queries, because that depends entirely on the destination.

One practical consequence: keep the redirects. Google's site move documentation says to "Keep the redirects for as long as possible, generally at least 1 year." Teams strip them after a quarter and are then surprised when referral traffic stops. External links, bookmarks, old newsletters and printed materials all outlive a quarter.

Redirect Chains and Loops, and What Each Hop Costs

Nobody builds a four hop chain on purpose. Chains accumulate. A rename one year, an HTTPS migration the next, a trailing slash rule added by somebody fixing an unrelated problem, and now one old URL takes three hops to reach a live page.

The documented limits are worth knowing exactly. Google's crawler guidance says: "By default, Google's crawlers follow up to 10 redirect hops. However, specific products' crawlers may have different limits." The site move documentation adds the practical version: Googlebot can follow up to 10 hops in a chain, but "we advise redirecting to the final destination directly." Note the per product caveat, because the crawler fetching your images is not necessarily the one fetching your HTML.

Ten hops sounds like room to spare. It is not. Here is what each hop actually costs:

CostWhat happens
LatencyEvery hop is a full round trip before any content is sent. If the scheme or host changes, add a TLS handshake and sometimes a DNS lookup. On a slow mobile connection this is measured in real seconds
Crawl effortEach hop is a separate fetch. Multiply by the number of retired URLs on a large site
FragilityEach hop is an independent rule that can break on its own. The chain is only as reliable as its weakest link
Rule collisionsChains form from rules that were never designed to interact. Adding one rule can silently lengthen an existing chain you were not thinking about
Limit exposureBecause the hop limit varies by crawler, a long chain can behave differently for different user agents. Different behavior for different crawlers is the hardest class of bug to reproduce

Loops are the failure mode where the chain never terminates. A browser gives up and shows ERR_TOO_MANY_REDIRECTS. Search Console reports Redirect error in the Page indexing report. The usual causes, in rough order of frequency:

  • A trailing slash rule and a lowercasing rule each undoing the other's output.
  • A CDN and an origin server both enforcing HTTPS, where the CDN terminates TLS so the origin always sees plain HTTP and always redirects.
  • A CMS level redirect and a server level redirect for the same path, pointing at each other.
  • A redirect whose destination still matches its own source pattern.

The fix for both problems is one discipline. Every redirect points at a final 200 response, never at another redirect. When you change a URL that was already the destination of an older rule, update that older rule rather than adding a new one behind it. That single habit is the difference between a redirect map that stays flat for years and one that grows a hop every quarter.

Trailing Slash and www Are Redirect Decisions Too

Four pairs exist on every site whether you have thought about them or not. In each one you pick a winner and redirect the other.

PairExampleThe decision
Scheme`http://` and `https://`Always HTTPS. 301 every plain HTTP request
Host`www.` and the bare domainEither works. Pick one and never revisit it
Trailing slash`/pricing` and `/pricing/`Either works. Pick one and apply it everywhere
Case`/Pricing` and `/pricing`Lowercase, and redirect anything else

The correctness point behind all four: /pricing and /pricing/ are different URLs. A server is entirely free to serve different content at each, so a search engine has to treat them as distinct until something tells it otherwise. Serve identical content at both with a 200 status and you have manufactured a duplicate, and the choice of which one to index gets made by a canonicalization process instead of by you. The one exception is the root, where https://www.sparkcliks.com and https://www.sparkcliks.com/ are the same URL and the slash is implied.

Now the part that creates chains on otherwise well run sites. Combine these into one rule that produces the final URL in a single hop. A request for http://www.sparkcliks.com/Pricing should land on https://www.sparkcliks.com/pricing/ with one redirect, not four stacked ones firing in sequence.

Ordering matters too. Canonicalization rules run first and produce a normalized URL. Path level redirects run after, against that normalized form. Get the order backwards and every path redirect you write gets a canonicalization redirect appended to it automatically, turning your whole redirect map into two hop chains without a single mistake in any individual rule.

Whichever you pick, your internal links, your sitemap, your canonical tags and your redirect rules all have to agree, and that agreement is worth testing rather than assuming. The usual failure is a site that normalizes one way across most of itself and the other way in a section built later by different people, so the same link pattern is correct in the main navigation and costs a hop in the blog. Run the curl check in the next section against a marketing page and a blog post before you assume the two behave identically.

Verify What the Redirect Actually Does

Two tools answering two different questions. curl tells you what your server does. Search Console tells you what the engine made of it. Use both, always.

Start with the full chain:

curl -sIL "https://www.sparkcliks.com/old-page"

-s silences the progress meter, -I requests headers only, -L follows redirects. You get one header block per hop. Read the status line and the Location header of each.

For a one line summary:

curl -sIL -o /dev/null \
  -w "%{num_redirects} hops, final %{http_code} at %{url_effective}\n" \
  "https://www.sparkcliks.com/old-page"

Now the gotcha that costs people an afternoon. -I sends a HEAD request, and some servers, CDNs and edge functions handle HEAD differently from GET. A redirect can look perfect on HEAD and behave differently for an actual visitor. Confirm with a real GET that dumps the headers and throws the body away:

curl -sL -D - -o /dev/null "https://www.sparkcliks.com/old-page"
CheckHowPassing result
The status code is the one you intended`curl -sIL``301` where permanent, `302` only where you meant temporary
One hop, not several`%{num_redirects}``1`
The destination is a real pageLast header block`200`, with no further `Location`
Query strings surviveAppend `?utm_source=test`, read `%{url_effective}`The parameter is still there
GET agrees with HEAD`curl -sL -D - -o /dev/null`Same chain, same final URL
The rule is not too broadRequest a similar URL that must stay live`200`, no redirect
Removed pages return 410, not 200`curl -sI` on the removed URL`410`

The query string row catches a common silent failure: plenty of redirect rules drop everything after the ?, which quietly destroys the campaign tracking parameters on every redirected link you have ever put in an email. The last two rows catch the other one. A rule written as a prefix match for /pricing happily swallows /pricing-guide/ as well, and nobody notices until that page's traffic disappears.

Then check what the engine made of it:

  • URL Inspection on the old URL. You want Page with redirect and the correct target. This confirms the engine has processed the redirect, which is a different fact from the redirect existing.
  • Page indexing report. Page with redirect is an expected, healthy status for a retired URL. It is not an error and it needs no fixing. Redirect error is the one to act on: chain too long, a loop, an empty Location, or a URL that exceeded a length limit.
  • Performance report. The old URL keeps appearing for a while after the change. Watch for the destination picking up those queries rather than for the old URL vanishing on a schedule you invented.
  • Removals tool. It hides a URL from results for roughly six months. It is a bandage for something urgent and embarrassing while the real fix propagates. It removes nothing from the index and it expires.

Run the curl checks against a sample of ten old URLs, not one. Redirect rules are pattern matches, and a pattern that works on the URL you tested is not evidence about the ninety you did not.

Frequently asked questions

FAQ

Should I set up redirects as 301 or 302?

Use 301 when the change is permanent, which covers renames, restructures, HTTPS migrations and domain moves, because it is a strong signal that the destination should become the canonical URL. Use 302 only when the original URL is genuinely coming back, such as a split test or an out of stock product. Remember that browsers cache 301s aggressively, so a mistaken 301 keeps firing for returning visitors even after you revert the rule.

Is it bad to redirect an old page to my homepage?

Yes, in almost every case. Google's site move documentation says redirecting many old URLs to one irrelevant destination such as the home page "might be treated as a soft 404 error", which means the old URL leaves the index anyway and the visitor lands somewhere that does not answer their query. Redirect to the closest page that actually serves the same intent, or return a 410 if nothing does.

Does a 301 redirect pass link equity?

Google's crawler documentation describes a 301 as a strong signal that the redirect target should be processed, and in 2016 a Google representative stated publicly that 30x redirects do not lose PageRank. There is no published figure for how much passes, and the percentages quoted around the SEO industry did not come from a search engine. What a redirect reliably does is route visitors and links to the new URL and tell the indexing pipeline which URL is canonical.

When should I use a 410 instead of a redirect?

Use 410 when the content is permanently gone and no page on your site serves the same intent, because a redirect to an unrelated page is worse than an honest error. Google's documentation treats all 4xx codes the same for indexing, so pick 410 for the clarity it gives your own team and your tooling rather than for a speed advantage. Return a useful page body with it, and never return 200 for a page that says it is gone.

How many redirects in a chain is too many?

Google's crawlers follow up to 10 hops by default, and the documentation notes that specific products' crawlers may have different limits, so treat 10 as a ceiling rather than a budget. Aim for exactly one hop from any old URL to a live page. Chains form quietly over years, so when you retire a URL that was already a redirect destination, update the original rule instead of stacking a new one behind it.

How long should I keep redirects in place?

Google's site move documentation advises keeping redirects "for as long as possible, generally at least 1 year", and there is rarely a good reason to remove them after that either. External links, bookmarks, printed materials and old emails keep sending people to the original URL for years. Removing a redirect turns every one of those into a 404 that will never show up in your own crawl.

About the Author

The SparkCliks Team writes about search click behavior, indexing and the measurement work that tells you whether a change did anything at all. SparkCliks provides search CTR and website traffic services, and the team spends most of its time inside Search Console and analytics reports separating signal from noise. Our position on technical guidance matches our position on our own products: say what the documentation supports, name the source, and mark the difference between a published fact and an industry habit. More at sparkcliks.com.

Keep reading

Related articles