RewriteEngine On RewriteCond %{HTTP_HOST} !^(www\.) RewriteCond %{HTTP_HOST} ^([^.]+)\.example\.com RewriteRule ^(.*)$ /home/%1/public_html$1 If you do not want to enable mod_dir, or you need a slightly different functionality than it offers, you may want to consider using mod_vhost_alias or mod_rewrite. The example shows how to use mod_rewrite to map requests for user.example.com to the appropriate per-user html directory. |