Back to blog

301 vs 302 redirects, explained

How permanent (301/308) and temporary (302/307) redirects differ in browser caching and click counting, and how to choose the right one.

You reach for a redirect when an address has moved but the old link must keep working, or when one link should send people to different places depending on the situation. "Send the browser somewhere else" sounds like one thing, but the status code you use changes the browser's behavior completely. Knowing the difference between 301 and 302 lets you explain why a link behaves unexpectedly, or why clicks aren't being counted.

What a redirect actually does

When a browser asks for an address, the server replies with a status code. 200 means "here is the content"; 404 means "no such thing." Codes that start with 3 mean "that content lives somewhere else," and they include a Location header carrying the new address.

The flow is short.

  1. The browser requests address A.
  2. The server replies with 301 or 302 and says "the real address is B."
  3. The browser immediately requests B.
  4. B returns the actual content with 200.

To the user it looks like a single click, but two requests went back and forth in between. That middle step is exactly what a short link does: it receives the short code address and uses a redirect to point the browser at the original.

Permanent vs. temporary

Redirects fall into two broad groups. The key question is whether the move is meant to last.

  • Permanent (301, 308) — a declaration that "this address has moved there for good." The browser trusts it and stores it in its cache.
  • Temporary (302, 307) — "go there for now, but ask again next time." The browser does not cache the result and asks the original address every time.

The difference shows up in search engines too. On a 301, a search engine moves the old address's ranking to the new one and replaces it in the index. A 302 leaves the original address in place and treats the move as a temporary detour. So a 301 is right when a page has truly relocated, and a 302 when you're only routing somewhere briefly.

Why a cached 301 swallows clicks

The caching behind 301 is usually a benefit. Once a browser learns "this is permanently over there," it skips the server next time and goes straight to B. One round trip disappears, and things get faster.

The trouble comes when something in the middle needs to count the clicks, as a short link does. A shortener records each visit when the browser stops by the short address. But if it answers the first request with a 301, the browser caches that fact and skips the shortener from the second visit on. If the same person clicks the same link five times, the server only sees it once. The other four clicks never get a chance to be recorded. And once a 301 is cached, the server can't take it back until it expires — so even if you later want to change the destination, that browser keeps going to the old address for a while.

A 302 avoids this trap. Because the move is temporary, the browser doesn't cache it and passes through the shortener every time. Every click gets counted, and if you change the destination, the next click reflects it right away. That is why Linkpado answers every short link with a 302. A cached 301 would drop repeat clicks and report fewer visits than really happened.

So which one should you use?

The rule of thumb is simple.

  • If you've moved a page or domain for good and want search ranking to follow to the new address, use 301. A site redesign or an address change is the typical case.
  • If you need to measure the link or change it later, use 302. Campaign links, short links, and A/B tests all want the option to count clicks or swap the destination.

There's one more pair of codes. 307 and 308 are cousins of 302 and 301, with one difference: they preserve the request method. Historically some browsers would turn a POST into a GET when following a 301 or 302; 307 and 308 are defined so that POST stays POST and GET stays GET. That matters when you redirect something like a form submission. For simply sending a link to a different page, 301 and 302 are enough.

In short: 301 for a permanent move (308 if you need to preserve the method), and 302 for temporary moves and measurement (307 if you need to preserve the method). A short link is almost always the latter. If you'd like to make a link and watch how it behaves, you can try it from the home page.