Question: I would like to shorten a url (e.g. <http://www.abc.com/products/bag.aspx>) to something like (http://short.me/bag). I have found that rules can be added to web.config to detect the short link to open the correct page. But I need a dynamic web.config. Is it a good idea to keep updating the web.config whenever a user creates the short url? Or is there a better way to do it?

I have tried `YOURLS`, `RewriteRule`, etc. All don't seems to work properly on my server. I am using a WIN server. I don't really want to use the bitly API as I would like to have my own domain in front of the link. Or is there a way to use the bitly API and still retaining my domain name?

Thank you.

Answer: 
You need to create a database mapping short URLs to long URLs.

You would then create an HTTP handler that looks up the short URL in that database and redirects to the corresponding long URL.  

Then, register that handler to run for all requests.
Bit.ly lets you use custom domain names now: <https://bitly.com/pro/products>, check out [this part of their FAQ](https://bitly.com/a/help#i_6_0)