How to add url redirect from subfolder to subdomain?

Run your website from subdomain instead of subfolder. Add a url redirect for all requests from http://www.example.com/blog to http://blog.example.com