mod_rewrite/preg_match - yes/no, is there better way?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I would like to offer my registered users to have very short uri for
their pages in our comunity site, so I have enabled wildcard dns
* and added virtaul host for it. (I'm testing this on one
domain I don't use so no harm will be done in testing time). and that is
working. than I tried to write mod_rewite rule in .htaccess which should
redirect to but I

rewriteEngine On
rewriteCond % !^$
rewriteCond % !^(www\.)?bellay\.com$ [NC]
rewriteCond %<->% ^(www\.)?([^.]+).*<->/([^/]+)
rewriteCond %2<->%3 !^(.*)<->$ [NC]
rewriteRule ^(.+) /%2/index\.php\?user\=$1 [L]

so, I delitet those lines from .htaccess file and in my index.php, I put
on very top:

$server_host = explode('.', $_SERVER['HTTP_HOST']);
$subdomain = strtolower($server_host[0]);
$not_users = "/\b(www|ftp|dev|mail|smtp|pop|server|localhost|root)\b/i";
if (preg_match($not_users,$subdomain)) {
        echo"   header(\"Location: /\");";
else {
        echo"   header(\"Location: =$subdomain\");";

and that is working, but, before I implement that on my real site, I
have to ask if there is any bettar way to do that? are there any
drowbacks or potential (security) dangerous waitnig for me?

thank you very much.

Site Timeline