I've got a problem that I don't get solved. I wish to make subdomains such user1.domain.com, user2.domain.com and thus continuously. user1, user2, user ... are customers on my small site. Crafting a question in htaccess? any idea?

You have to activate the per-user sites first : see http://httpd.apache.org/docs/trunk/en/howto/public_html.html

You'll be able to you mod_rewrite to alias user1.domain.com to domain.com/~user1, like:

RewriteEngine on
RewriteCond %{HTTP_HOST} (.*)\.domain\.com
RewriteRule (.*) http://domain.com/~%1/$1

To become simple. You may also make per user RewriteRule if you won't want to make use of a global setting and you do not have a lot of customers.

Use a mixture of the wildcard option in apache's VirtualHost configuration section, and mod_rewrite. Articles with a few good particulars are available here:


This would need to be completed in your apache configuration httpd.conf file, however, as .htaccess doesn't permit VirtualHost sections.