ArticleslgStudy

science

URL shortening

URL shortening is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand URL shortening rather than just read about it. In short: URL shortening is a technique on the World Wide Web in which a Uniform Resource Locator (URL) may be made substantially shorter and still direct to the required page. This is achieved by using a redirect which links to the web page that has a long URL.

URL shortening — main illustration
URL shortening — illustration

Key takeaways

  • URL shortening belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect URL shortening to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of URL shortening from memory before moving on to harder problems.

Reference excerpt

URL shortening is a technique on the World Wide Web in which a Uniform Resource Locator (URL) may be made substantially shorter and still direct to the required page. This is achieved by using a redirect which links to the web page that has a long URL. For example, the URL "https://en.wikipedia.org/wiki/URL_shortening" can be shortened to "w.wiki/U". Often the redirect domain name is shorter than the original one. A friendly URL may be desired for messaging technologies that limit the number of characters in a message (for example SMS), for reducing the amount of typing required if the reader is copying a URL from a print source, for making it easier for a person to remember, or for the intention of a permalink. In November 2009, the shortened links of the URL shortening service Bitly were accessed 2.1 billion times. Other uses of URL shortening are to "beautify" a link, track clicks, or disguise the underlying address. This is because the URL shortener can redirect to just about any web domain, even malicious ones. So, although disguising of the underlying address may be desired for legitimate business or personal reasons, it is open to abuse. Some URL shortening service providers have found themselves on spam blocklists, because of the use of their redirect services by sites trying to bypass those very same blocklists. Some websites prevent short, redirected URLs from being posted.

Purposes There are several reasons to use URL shortening. Often regular unshortened links may be aesthetically unpleasing. Many web developers pass descriptive attributes in the URL to represent data hierarchies, command structures, transaction paths or session information. This can result in URLs that are hundreds of characters long and that contain complex character patterns. Such URLs are difficult to memorize, type out or distribute. As a result, long URLs must be copied and pasted for reliability. Thus, short URLs may be more convenient for websites or hard copy publications (e.g. a printed magazine or a book). The latter often requiring that very long strings be broken into multiple lines (as is the case with some e-mail software or internet forums) or truncated. On X and some instant messaging services, there is a limit to the number of characters a message can carry. X now shortens links automatically using its own URL shortening service, t.co, so there is no need to use a separate URL shortening service just to shorten URLs in a tweet. On other such services, using a URL shortener can allow linking to web pages which would otherwise violate this constraint. Some shortening services, such as tinyurl.com and bit.ly can generate URLs that are human-readable, although the resulting strings are longer than those generated by a length-optimized service. URL shortening sites provide detailed information on the clicks a link receives, which can be simpler than setting up an equally powerful server-side analytics engine, and unlike the latter, does not require any access to the server. URLs encoded in two dimensional barcodes such as QR code are often shortened by a URL shortener in order to reduce the printed area of the code, or allow printing at lower density in order to improve scanning reliability.

Registering a short URL Some websites create short links to make sharing links via instant messaging easier, and to make it cheaper to send them via SMS. This can be done online, at the web pages of a URL shortening service; to do it in batch via bulk upload with tools like CSV importer or on demand may require the use of an API. A few well-known websites have set up their own URL shortening services for their own use – for example, Twitter with t.co, Telegram with t.me, Google with g.co, and GoDaddy with x.co.

Techniques

In URL shortening, every long URL is associated with a unique key, which is the part after its top-level domain name. For example, https://tinyurl.com/m3q2xt has a key of m3q2xt, these keys are case-sensitive most of the time and using the wrong case may lead to a different destination URL. Not all redirection is treated equally; the redirection instruction sent to a browser can contain in its header HTTP response status codes such as 301 (moved permanently), 302 (found), 307 (temporary redirect) or 308 (permanent redirect). There are several techniques to implement URL shortening. Keys can be generated in base 36, assuming 26 letters and 10 numbers. In this case, each character in the sequence will be 0, 1, 2, ..., 9, a, b, c, ..., y, z. Alternatively, if uppercase and lowercase letters are differentiated, then each character can represent a single digit within a number of base 62 (26 + 26 + 10). In order to form the key, a hash function can be made, or a random number generated so that key sequence is not predictable. Or users may propose their own custom keys. For example, https://example.com/product?ref=01652&type=shirt can be shortened to https://tinyurl.com/exampleshirt. Not all URI schemes are capable of being shortened as of 2011, although URI schemes such as http, https, ftp, ftps, mailto, mms, rtmp, rtmpt, ed2k, pop, imap, nntp, news, ldap, gopher, dict and dns are being addressed by such services as URL shorteners. Typically, data: and javascript: URLs are not supported for security reasons, to combat attacks like cross-site scripting and session hijacking. Some URL shortening services support the forwarding of mailto URLs, as an alternative to address munging, to avoid unwanted harvest by web crawlers or bots. This may sometimes be done using short, CAPTCHA-protected URLs, but this is not common. Makers of URL shorteners usually register domain names with less popular or esoteric Top-level domains in order to achieve a short URL and a catchy name, often using domain hacks. This results in registration of different URL shorteners with a myriad of different countries, leaving no relation between the country where the domain has been registered and the URL shortener itself or the shortened links. Top-level domains of countries such as Libya (.ly), Samoa (.ws), Mongolia (.mn), Malaysia (.my) and Liechtenstein (.li) have been used as well as many others. In some cases, the political or cultural aspects of the country in charge of the top-level domain may become an issue for users and owners, but this is not usually the case. Services may record inbound statistics, which may be viewed publicly by others.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with URL shortening

Start with the simplest possible case. Write down what URL shortening claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to URL shortening before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about URL shortening ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of URL shortening

In research
URL shortening appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses URL shortening in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
URL shortening is common in secondary-school and first-year university syllabi. It links to neighbouring topics Internet terminology, URL, URL-shortening services, so understanding it makes those chapters shorter.
In everyday life
Look for URL shortening outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “URL shortening” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study URL shortening in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what URL shortening means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain URL shortening out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is URL shortening in simple terms?

URL shortening is a technique on the World Wide Web in which a Uniform Resource Locator (URL) may be made substantially shorter and still direct to the required page. This is achieved by using a redirect which links to the web page that has a long URL.

Why does URL shortening matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study URL shortening?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on URL shortening.

Tags

  • Internet terminology
  • URL
  • URL-shortening services

Keep exploring