RewriteEngine On
RewriteBase /
RewriteRule ^.htaccess$ - [F]
RewriteCond %{HTTP_HOST} !^www.site.ru$ [NC]
RewriteRule ^(.*)$ http://www.site.ru/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php [L]