Setup discourse for the main site (www.example.com) not on a subdomain

if you set your DNS records so that the A Record for both points to discourse, then its possible.