RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.info [NC] RewriteRule ^(.*) http://domain.info/index.php?user=%1 [P,L]