How should I setup my .htaccess file I want to point any domain.com/page to the www.domain.com/page without showing index.php in my urls. 

I have a www and non-www A record pointing to an IP address.

How do I set up my .htaccess file to do this?
Here's what I'm using:

# Remove the www from the URL
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

# Exclude root files
RewriteCond $1 !^(favicon\.ico|favicon\.png|fb_share\.jpg|apple-touch-icon\.png|apple-touch-icon-precomposed\.png|index\.php|robots\.txt) [NC]

# Exclude asset folders
RewriteCond $1 !^(assets|uploads)/ [NC]

# Remove index.php
RewriteRule ^(.*)$ /index.php/$1 [L]


You could also set up a CNAME record from www.domain.com to domain.com in your DNS.