Try it on your own data
Every report in this article is in the free plan. One snippet for web and apps, up to 10 sites.
Start freeA 301 redirect says a URL has moved permanently; a 302 says the move is temporary and the original URL should keep being used. Google treats the first as a strong signal to show the new address. Neither one keeps your UTM parameters unless the redirect rule copies the query string into the target.
What you will learn
- Use 301 or 308 for permanent moves and 302 or 307 for temporary ones; 307 and 308 keep the request method
- A redirect drops UTM parameters when its target omits the query string, whatever the status code
- Browsers may cache a 301, so launch as 302, verify targets and parameters, then make it permanent
What is the difference between a 301 and a 302 redirect?
Both tell a client that the content it asked for is at another URL, given in the Location header. The difference is the promise attached. 301 Moved Permanently says the resource has a new permanent address and future references should use it. 302 Found says the resource is temporarily somewhere else, and the client should keep using the original URL next time. Those definitions come from RFC 9110, the HTTP standard published in June 2022.
Two more codes exist because of an old accident. The standard allows a browser to turn a POST into a GET when it follows a 301 or 302, so 307 and 308 were added to forbid that change. The result is a two-by-two grid plus one special case:
May change POST to GET | Keeps the method | |
|---|---|---|
| Permanent | 301 Moved Permanently | 308 Permanent Redirect |
| Temporary | 302 Found | 307 Temporary Redirect |
The special case is 303 See Other, which sends the client to a different resource that answers the original request, typically a result page after a form submission.
The numbers do not say how long "temporary" lasts. RFC 9110 sets no duration. What it gives you is intent, and clients act on it: whether to remember the new address, whether to cache the answer, and, for search engines, which of the two URLs to show.
| Code | Duration | Method | Cacheable by default | Google signal for the target |
|---|---|---|---|---|
| 301 Moved Permanently | Permanent | POST may become GET | Yes, heuristically | Strong |
| 302 Found | Temporary | POST may become GET | No | Weak |
| 303 See Other | Points to a result resource | Follow with GET or HEAD | No | Treated as temporary |
| 307 Temporary Redirect | Temporary | Kept | No | Same as 302 |
| 308 Permanent Redirect | Permanent | Kept | Yes, heuristically | Same as 301 |
Method and caching rules from RFC 9110 section 15.4; Google treatment from its redirect and status code documentation, checked 2026-12-03.
Which redirect status code should you use?
Decide two things in order. First, will this redirect ever be removed or pointed somewhere else? Second, does the request carry a method and body that must survive, as with form posts and API calls?
| Situation | Code | Reason |
|---|---|---|
| Page moved to a new URL for good | 301 | Permanent, widely understood |
Site moved to a new domain or to https | 301 or 308 | Permanent; use 308 where POST must stay POST |
| API endpoint renamed for good | 308 | The method and body are preserved |
| Short sale page standing in for a product page | 302 | The original URL will return |
| Maintenance detour for a form or API | 307 | Temporary and keeps the method |
| Redirect after a successful form post | 303 | The next request should be a GET for the result |
| Country or language suggestion | 302, or no redirect | The choice depends on the visitor, and may change |
| Page removed with no replacement | No redirect: 404 or 410 | Sending everyone to the home page hides the removal |
For the last row, the reasoning and a triage method are in how to fix 404 errors. If you are unsure whether a move is permanent, a 302 is the cheaper mistake: browsers do not cache it by default, so you can change your mind. Switch to 301 once the decision is made.
What do 301 and 302 redirects mean for Google Search?
Google's redirect documentation splits redirects the same way. With a permanent server-side redirect (301 or 308), Googlebot follows it and uses it as a signal that the target should be the canonical URL, so the new address is the one to show in results. With a temporary one (302, 303 or 307), Google follows it but does not treat it as that signal, so the old URL is more likely to stay in results.
The page on how status codes affect Google's crawlers puts it as a strong signal for 301 and a weak signal for 302 that the target should be processed, with 308 treated like 301 and 307 like 302. The same page notes that the codes are still semantically different, so other clients benefit when you pick the accurate one.
Three practical points follow.
- Hop count. Google's crawlers follow up to 10 redirect hops by default. Aim for one. A sequence of rules that grew over several migrations is a redirect chain, and it costs time on every visit.
- How long to keep them. For a site move, Google advises keeping redirects as long as possible, generally at least one year.
- Other kinds of redirect. Google reads an instant meta refresh as permanent and a delayed one as temporary. JavaScript redirects depend on rendering succeeding, so use them only when server-side and meta refresh are not possible.
A long-running 302 is not automatically a problem, and no published number of days turns it into a 301. If the move is permanent, say so with the status code instead of waiting for a search engine to infer it.
Do redirects keep UTM parameters and the referrer?
This is where a redirect that "works" can still damage reporting. The two pieces of information travel differently.
UTM parameters live in the URL. The browser requests whatever address is in Location. If the rule writes a new URL without the original query string, utm_source, utm_medium and ad click IDs are gone before the page loads. This has nothing to do with 301 versus 302; either code drops them if the target omits them. The UTM parameters have to be copied into the target by the rule.
The referrer travels in a request header. When a browser follows a server redirect, it still determines the Referer from where the navigation started, under the referrer policy in force. Three things change what arrives:
| What happens on the way | Effect on the referrer at the final page |
|---|---|
| A normal HTTPS 301 or 302 | The original referring site is still reported, trimmed by policy |
The redirect response sends its own Referrer-Policy | That policy replaces the request's policy for the next hop; no-referrer removes it |
A hop from https to http | Under the default strict-origin-when-cross-origin, no referrer is sent to the less secure address |
| Meta refresh or JavaScript redirect | It is a new navigation from the intermediate page, so the referrer is normally that page, if its policy allows one |
The default policy also sends only the origin, not the full path, across sites. That is normal and not a redirect fault; see referrer policy strict-origin-when-cross-origin.
When both are lost, the visit has nothing to identify it and lands in direct traffic. When only the parameters are lost, it may be reported as a referral or social visit, so the traffic is there but the campaign is not.
One thing a redirect does keep without help: a fragment. RFC 9110 says that if Location has no # part, the browser applies the fragment of the original URL to the new one.
Worked example: a campaign that turned into direct traffic
Sample data: a newsletter links to https://example.com/offer?utm_source=newsletter&utm_medium=email&utm_campaign=spring. During a URL cleanup, someone adds a 301 from /offer to /spring-offer without the query string. Email programs usually send no referrer, so nothing identifies the visitors.
In one week the newsletter brings 4,000 sessions that convert at 3%, which is 120 conversions. Without the redirect fault, direct traffic would have been 10,000 sessions with 200 conversions.
| Channel in the report | Correct | With the query string dropped |
|---|---|---|
| Email sessions | 4,000 | 0 |
| Email conversions | 120 | 0 |
| Email conversion rate | 120 ÷ 4,000 = 3.0% | no data |
| Direct sessions | 10,000 | 14,000 |
| Direct conversions | 200 | 320 |
| Direct conversion rate | 200 ÷ 10,000 = 2.0% | 320 ÷ 14,000 = 2.29% |
| Total sessions and conversions | 14,000 and 320 | 14,000 and 320 |
The totals are identical, which is why nobody notices on a headline dashboard. The damage is in the split: the newsletter appears to have done nothing, and direct traffic appears to have grown by 40% and improved its conversion rate. A budget decision made on that table would cut the channel that worked.
The fix is one change to the rule so that the target carries the query string. Visits already recorded do not change, so note the dates on which the rule was wrong.
Sessions by channel when a redirect drops the query string
sample weekWhy do 307 and 308 exist?
For a normal page view the method is GET, and the four codes behave the same in a browser. The difference appears when something sends data. RFC 9110 notes that early browsers disagreed about whether to repeat a POST after a 301 or 302, practice settled on changing it to GET, and 307 and 308 were added to mean "repeat exactly what you sent".
A payment callback, a webhook or a mobile app posting events to an old endpoint can therefore arrive at the new address as an empty GET after a 301. The sender sees a redirect that succeeded; the receiver sees no body. Use 308 for a permanent move of such an endpoint, and 307 for a temporary one. Better still, update the sender, because not every HTTP client follows redirects for non-GET requests.
The command-line tool curl behaves the same way: with -L, it follows a POST with a GET after 301, 302 or 303, and resends the same method after other 3xx codes.
Why is a wrong 301 hard to take back?
RFC 9110 marks 301 and 308 responses as heuristically cacheable: unless explicit cache headers say otherwise, a cache may store them and decide for itself how long. 302 and 307 carry no such permission.
In practice, a visitor who received a mistaken 301 may keep going to the wrong target without asking your server again, and removing the rule on the server does not reach them. Two habits reduce the risk:
- Launch with a 302, then switch. Run the new rule as temporary for a day, check the targets and the query strings, then change the code to 301.
- Set a cache lifetime on permanent redirects. An explicit header such as
Cache-Control: max-age=3600during the first weeks limits how long a mistake survives. Lengthen it once the rule has proved correct.
If a wrong 301 is already out, you can redirect the wrong target back or publish content there, but you cannot clear other people's caches.
How to write the rule so the query string survives
Syntax differs, and so does what happens to the query string by default.
| Server and directive | Rule | Query string |
|---|---|---|
nginx return | return 301 https://example.com/spring-offer$is_args$args; | Only what you write is sent, so include $is_args$args |
nginx rewrite | rewrite ^/offer$ /spring-offer permanent; | Original arguments are kept, and appended after new ones; a trailing ? drops them |
Apache Redirect | Redirect 301 /offer https://example.com/spring-offer | Passed on to the target |
Apache mod_rewrite | RewriteRule ^/offer$ /spring-offer [R=301,L] | Passed through unless the substitution has its own query; the QSD flag discards it |
Note the defaults hiding in these tools: Apache's Redirect without a status argument and nginx's rewrite ... redirect both produce a 302. A rule meant to be permanent has to say so. The Apache behavior is documented for mod_alias and mod_rewrite. Paths in .htaccess files are matched differently from server configuration, so test where you put the rule.
How to test a redirect with curl
Run these against the real campaign URL, with its parameters, and quote the URL so the shell does not split it at &.
- See the first response.
curl -sI "https://example.com/offer?utm_source=test&utm_medium=email"prints the status line andlocation. Check the code and whether the parameters are in the target. - Follow the whole path. Add
-Lto print the headers of every hop. - Summarize.
curl -s -o /dev/null -L -w "%{http_code} %{num_redirects} %{url_effective}\n" "URL"prints the final status, the number of hops and the final address, using aGETrequest. Some servers answer a header-only request differently, so run this too. - Check the variants. Repeat with
http://, with and withoutwww, with a trailing slash and with an ad click ID. - Check the referrer headers. Look for a
referrer-policyline on any redirect response.
For many URLs at once, feed a list to a crawler or a script; how to check URL status codes covers building the list and ranking the failures.
How to verify the effect in TapCub
Take the newsletter above. Server redirects happen before the analytics script loads, so TapCub records the final page and whatever address and referrer arrived with it. That makes it a good end-to-end check.
- Click your own test link. Open the campaign URL with a test campaign name, then look at Web analytics › Realtime to confirm the visit arrived on the new page.
- Check the campaign. In Web analytics › Sources, open the UTM tab. UTM values are read from the address of the pageview, so if the test campaign is missing, the rule dropped the parameters.
- Look for the shift. In the same report, compare the channel mix before and after the migration date. Email falling while direct rises by a similar amount is the pattern in the table above.
- Mark the dates. Record when the rule changed in Configuration › Annotations, so the broken week is not read later as a weak campaign.
TapCub does not create or manage redirects; those live in your server or CDN. To see which status codes search engine crawlers receive, you need server logs or server events, which feed Monitoring › Crawl health.
FAQ
Is a 301 or 302 better for SEO?
Neither is better in general; each states something different. Use 301 or 308 when the move is permanent, because Google treats it as a signal that the target should be canonical. Use 302 or 307 when the original URL will return, so that it can stay in search results.
Does a 302 redirect pass ranking signals?
Google's documentation describes a 302 as a weak signal that the target should be processed, and does not use temporary redirects as a signal that the target should be canonical. Other signals can still lead it to index the target. If you want signals to move, use a permanent redirect.
Do 301 redirects lose UTM parameters?
Only if the rule writes a target without them. The status code does not decide this. Test the actual campaign link with curl and read the location header. If the query string is missing there, change the rule so that it appends the original arguments to the new URL.
Can I change a 302 to a 301 later?
Yes, and it is a sensible order: launch as temporary, verify, then make it permanent. Going the other way is harder, because browsers may have cached the 301 and will not ask your server again until their copy expires or the visitor clears it.
How many redirects in a row are too many?
Google's crawlers follow up to 10 hops by default, but that is a limit, not a target. Each hop adds a round trip before the page starts to load. Point every old URL directly at the final address, and update your own links so they need no redirect at all.
Sources
- IETF, RFC 9110: HTTP Semantics, section 15.4: Redirection 3xx, June 2022.
- Google Search Central, Redirects and Google Search, and site moves with URL changes. Checked 2026-12-03.
- Google, How HTTP status codes affect Google's crawlers. Checked 2026-12-03.
- W3C, Referrer Policy, section 8.2: set request's referrer policy on redirect. Checked 2026-12-03.
- nginx documentation, ngx_http_rewrite_module. Checked 2026-12-03.
Was this article helpful?
We use your answers to fix and expand this page.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.

Product Analyst
Focuses on event analysis, conversion funnels, and retention, using clear metric definitions and structured analysis to explain product performance.



