Comment on 301 Redirect Htaccess by Moonlight.

301 Redirect Htaccess To use the default setting ( non-www and www ) both, in the free hosting try this:

RewriteEngine on
RewriteBase /
rewritecond %{http_host} ^JUSTYOURDMAINNAME\.net [nc]
rewriterule ^(.*)$ http://www.YORDOMAIN.net/$1 [L,R=301]

JUSTYOURDMAINNAME = without .com, .net, etc…. JUST NAME.
YORDOMAIN = full domain name.
I try that with my free hosting and its working great, sorry for my broken English.