How to Redirect www to Non-www with Apache

Many web developers need to allow their users to access their website or application via both the www subdomain and the root (non-www) domain. This tutorial shows how to configure the Apache web server to redirect requests from a www subdomain to the root domain.