Forward only root domain?

I’ve got a domain that has a wiki on the main domain, and several subdomains. I want to forward the top level domain,, to a completely new domain, However, I want the wiki and the subdomains and any other subdirectories to remain intact under the original domain name.

I originally thought I would just set up a redirect, but it appears that will affect all the subdirectories, including the wiki. Is there a way to do it with the htaccess file? Currently I’ve got it set to forward to the wiki:

RewriteEngine On RewriteRule ^wiki/(.*)$ /w/index.php?title=$1 [PT,L,QSA] RewriteRule ^wiki/*$ /w/index.php [L,QSA] RewriteRule ^/*$ /w/index.php [L,QSA]

Would this work, or would this forward the wiki and subdirectories as well?

RewriteEngine on RewriteRule ^$ [R=301,L]

Is there a good page that explains what each of the expressions in the rewrite mean? I feel like I almost understand it, but just not quite.