How to re-direct non WWW to WWW using web.config

Here is the URL Rewrite Rule in the IIS web.config file that redirects non-www requests to www requests for your domain name. Make sure you replace example.com with the name of your domain.