Thread:Project:Support desk/non-www redirect for mediawiki

Hello. How how to make 301 redirect from www.site.com to site.com. Have read the entire internet and not found solutions. install directory - /w in root directory - .htaccess with the following content RewriteEngine On RewriteCond %{HTTP_HOST} ^www.site.com/w RewriteRule ^(.*)$ http://site.com/w/$1 [r=301,L] RewriteRule ^wiki/(.*)$ /w/index.php?title=$1 [PT,L,QSA] RewriteRule ^wiki/*$ /w/index.php [L,QSA] RewriteRule ^/*$ /w/index.php [L,QSA]

Is that correct?. How do you do a 301 redirect on own wiki-sites?