# (force addition of www depending on your cert) rewriteEngine On rewriteCond % !^www\. rewriteRule ^(.*)$ http://www.%/$1 [R=301,L]
When You need to change the root folder of the website transparently with no touching actual scripts, then this one would help.