<IfModule mod_rewrite.c>
RewriteEngine On
##non-www to www
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1\.html [L,NC]

ErrorDocument 404 /error_404.html
ErrorDocument 500 /error_500.html
 
</IfModule>
