How URL Shorteners Actually Work: Redirects, Status Codes and Caching
Created on 16 November, 2026 • Short URL • 4 views • 5 minutes read
A short link is a redirect with a database behind it. Here is what happens between the click and the destination, and which HTTP status code you should be sending.
A short link looks like magic and is almost embarrassingly simple underneath: it is a lookup table plus an HTTP redirect. Understanding the mechanics matters, because nearly every short-link problem people run into - lost analytics, stale destinations, links that stop working on one platform but not another - traces back to one of the four steps below.
What happens between the click and the destination
When someone opens example.link/ab12cd, four things happen in sequence.
1. DNS resolution. The browser resolves example.link to an IP address. This is the same lookup any domain goes through, and it is the first place a short link can fail: if the shortening domain's DNS is misconfigured, expired or blocked by a corporate resolver, nothing after this point matters. You can inspect this yourself with a DNS lookup.
2. The request hits the redirect service. The service takes the path - ab12cd - and looks it up in a database. That key is usually a short, base62-ish string (digits plus upper and lower case letters), which is why six or seven characters give you billions of combinations.
3. Side effects run. This is where click tracking happens: the service records the timestamp, the referrer, a coarse location derived from the IP address, and a parsed user agent. Some services also fire tracking pixels here, or check the destination against a blocklist.
4. The service answers with a redirect. It sends an HTTP status code in the 3xx range plus a Location header containing the real destination. The browser then makes a second request to that destination. The short-link service never sees the destination page; it only hands over the address.
That second request is important: the browser sends the original short domain as the Referer for the destination page in some configurations, which is one reason your analytics can attribute traffic to the shortener rather than the real source. The fix is UTM parameters on the destination, not on the short link - a subject covered in the UTM parameters guide.
301, 302, 307, 308 - which one should a short link send?
All four are redirects, but they behave very differently in practice.
- 301 Moved Permanently. Tells clients the move is permanent. Browsers and intermediate caches are allowed to cache it aggressively, sometimes indefinitely, and many do. Search engines pass ranking signals through it.
- 302 Found. A temporary redirect. Clients are expected to keep using the original URL and re-request it each time.
- 307 Temporary Redirect. Like 302, but it guarantees the request method is preserved. A POST stays a POST.
- 308 Permanent Redirect. Like 301, but it also preserves the method.
For a trackable short link, 302 (or 307) is almost always the right answer, and it is what most link services send by default. The reason is blunt: a cached 301 produces no click. If a browser has cached the permanent redirect, the second click never reaches your server, so it never appears in your statistics, and - worse - if you later edit the destination, that browser keeps going to the old one. You will debug this for an hour before you remember the 301.
Use 301 only for permanent, non-tracked moves, such as redirecting an old domain to a new one, where cacheability is the feature rather than the bug.
You can check what any link actually sends with an HTTP headers lookup or by tracing the full chain with a redirect checker.
Redirect chains, and why they cost you clicks
A redirect chain is what you get when a short link points at another short link, or at a URL that itself redirects - for example when your destination forces HTTPS, then forces the www variant, then redirects to a localised path. Each hop is a full round trip: DNS, TCP, TLS, request, response.
On a fast desktop connection a three-hop chain is barely noticeable. On a congested mobile network it can add a second or more before anything is drawn on screen, and that is exactly the moment people hit the back button. Chains also break tracking in subtle ways, because some platforms strip query parameters when they follow a redirect, and some strip the referrer.
Two practical rules: never point a short link at another short link, and point short links at the final canonical URL - with the right scheme, the right host and the trailing slash your server actually uses - so the destination does not need to redirect again.
Where the click data comes from, and its limits
Click statistics are derived entirely from the redirect request. That gives you a timestamp, an IP address, a user agent string and a referrer, and everything else is inference on top of those. Country and city come from an IP geolocation database, which is accurate at country level and wobbly at city level, and simply wrong for anyone on a VPN. Device and browser come from parsing the user agent, which messaging apps and in-app browsers routinely misreport.
There is also a category of clicks that no human made. Link scanners in email security products, chat apps generating link previews, and crawlers all fetch short links. Some services filter the obvious ones; none catch them all. This is the main reason a short link's click count rarely matches the session count in your analytics, which is worth understanding in detail - see why clicks and sessions never match.
What this means for how you use short links
A few conclusions follow directly from the mechanics:
- The short link is infrastructure, not decoration. If the domain lapses or the service disappears, every link ever printed on a poster or embedded in a PDF goes dead at once. That risk is covered in link rot and short links.
- Put campaign parameters on the destination URL. The shortener stores whatever you give it and hands it to the browser, so UTM tags survive the redirect if they are part of the destination.
- Use your own domain where trust matters. The redirect behaviour is identical, but the thing a human reads before clicking is not. See custom domains for short links.
- Expect the destination to change. The whole point of the indirection is that you can repoint a link after it has been printed. Choose a service that lets you edit the destination, and avoid 301 so the edit actually takes effect.
None of this is complicated, but all of it is easy to get wrong silently. A redirect that returns the wrong status code still works - it just quietly costs you data.
Popular posts
-
-
Bio link pagesBio link pages • 5,372 views
-
Short URL best way to track your linksShort URL • 5,253 views
-
-