Hacker News new | past | comments | ask | show | jobs | submit login

I wonder how well a shortener that included a clue about the domain would be. e.g. suppose that you shortened an amazon.com link to

http://amazon.XXX.YY/ABC

where XXX.YY is some suitable 6 letter domain name and ABC is a three letter hash. Assuming three letters from the valid [0-9A-Za-z] you have 62^3 possible links _per domain_. Extending to four characters you'd have 62^4 (over 14m links _per domain_).

So an amazon.com link would drop to 25 characters. A TinyURL link is currently 25 characters (bit.ly would be 18). So this is still in the ballpark.

Of course, the results aren't consistent (e.g. a ycombinator.com link would have 30 characters). But it would give a lot of information. Also, I think for non-.coms you'd have to include the TLD.

An advantage of using subdomains it that on YC/Reddit/Digg these links could easily be made to show as, for example, amazon.XXX.YY




You should probably consider truncating long domains. Maybe if it is > 7 characters, truncate to 7. Something like that. It would run the risk of collisions.

It may be worth also allowing users to suggest the shortening of the url the first time a domain is submitted. Just truncate ycominbator to yc etc.

I love this idea and if you decide not to pursue it, please let me know as this is something I would eagerly work on.


I am working on it.


If for some unexpected reason you need a hand, I'd be more than happy to help out. I'm pretty handy with php and I know I could throw together a better looking page than tinyurl.com.


I built it: http://twi.bz. It's very, very alpha. Email me with any problems.


That sounds like a really good idea actually. The only problem with this is that it would take more than the typical 10 lines of code (9 for interface) to set up a url shortener. Currently, all you need to set up a url shortener service is a domain name and a database.


It's about 11 lines of code. All you need to do add a wildcard entry in the DNS so that *.XXX.YY resolves to the same IP as XXX.YY, tell Apache to accept all Hostnames for that IP address, extract the subdomain from the hostname while extracting the hash.

I reckon I could get this up and running in about an hour if enough people upvote this comment :-)


I built it: http://twi.bz. It's very, very alpha. Email me with any problems.


Someone did it already: http://decenturl.com/


That doesn't do the same thing. It doesn't make short URLs, it makes shorter URLs that try to be readable.


You're right. I read your post before completely wake up.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: