How can I create shorter URLs to sites on my computer?

I was wondering if I could use my Windows 7 hosts file to create shorter URLs for sites? OR is there another way. I tried ones like the following but I'm guessing it only works with IP Addresses?

http://www.google.com goog

OR

http://www.google.com goog.le (didn't really use this just another example)


Solution 1:

Unless you're willing to get the IP address for every site you wish to shorten. It's not very feasible, but it works.

Edit your hosts file and input as follows:

74.125.47.103 goog

If you go into your web browser and type goog, goes directly to that IP.

It works if you wanna go straight to the IP, but if you're looking to input entire URLs, it's not a feasible solution and it's not going to work.

Solution 2:

The hosts file only is suitable for mapping hostnames to IP adresses, thus it can't be used for this purpose.

A workaround can be creating bookmarks named after the "keywords" you want to use. E.g. a bookmark called 'goog' that redirects to http://www.google.com. With a service like Xmarks, it can be used across browsers.