Shortening URLs with uURL

uURL (micro URL) is a hassle-free URL shortener that focuses on creating super-short URLs and redirecting the user to their final destination quickly and efficiently.

uURL - URL shortening service

The key to a good URL shortening service centers around the redirection. Being able to redirect users quickly will improve usability and help them forget that they are going through a 3rd party to get to the website they want to view.

Redirecting to another webpage is easy in ASP .NET MVC 3.

public ActionResult Index(string shortName) {

  //Get the URL from the short name.
  UrlRepository repo = new UrlRepository();
  string url = repo.GetUrl(shortName);

  //If the URL doesn't contain a parameter, return the View.
  if (string.IsNullOrEmpty(url)) {
    return View();
  }

  //Re-direct the user to their desired website.
  return Redirect(url);
}

If the user comes to the site with parameters in the URL then we know that they are interested in being redirected to another site and we don't even want to return the View to them. By doing this we can actually redirect the user right from the Controller and skip the added hassle of forcing the user's browser to render all of the View elements.

The source code for uURL can be found on Github and is released under the Open Source Public License.

uURL is free to use and enjoy.

Creative Commons License

What do you think?