<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^site\.ru [NC]
RewriteRule ^(.*)$ http://www.site.ru/$1 [R=301]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^index.php http://www.site.ru/ [R=301]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^main/? http://www.site.ru/ [R=301]
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteRule ^([a-z0-9A-Z_\-]+)/*$ http://www.site.ru/$1/ [R=301]
</IfModule>