Mobile app version of vmapp.org
Login or Join
Jennifer507

: Do url shortening services shorten the id or directly the url? Assuming the urls are saved to a database where they each have id and the URL saved. For example a URL www.example.com (let's

@Jennifer507

Posted in: #Url #UrlShorteners

Assuming the urls are saved to a database where they each have id and the URL saved.

For example a URL example.com (let's say with id 1000) would possibly be shortened to url.com/c1hd5 etc.

Is the URL id=1000 shortened to c1hd5 with base64 or similar or are the ids shortened?

The 566 id could be shortened like this: 1 = 1, 2 = 2, ... 9 = 9, 10 = a. The 1000 id would be fE if we used every possible letter from a-Z and - _.

Is it good idea to use ids from database to shorten urls?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Jennifer507

1 Comments

Sorted by latest first Latest Oldest Best

 

@Kimberly868

I would not assume that the id is present in the shortened URL at all. At the simplest level the shortening service is a simple lookup between the real URL and the shortened one, where the short form is either generated from some function (base64 sounds plausible) or even simply the next url in a list (unlikely)

There's no guarantee that:


example.com/some-path/id=1000


and


example.com/some-path/id=1001


will shorten to anything remotely similar.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme