There are several ways. To do it in the htaccess file, you'd want to use this:

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^DOMAIN [nc]
rewriterule ^(.*)$ DOMAIN/$1 [r=301,nc]

Best,
Noah -