View Single Post
  #2  
Old 16th August 2005, 22:51
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Create a DNS A record for user2.exampledomain.com that points to the same IP address as www.exampledomain.com.
In the vhost (Apache) for www.exampledomain.com, add user2.exampledomain.com under ServerAlias.
Then add rewrite rules to the vhost (you must have mod_rewrite enabled!), something like this:

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST}   ^user2\.exampledomain\.com [NC]
RewriteRule ^/(.*)         http://www.exampledomain.com/~user2/$1 [L,R]
and restart Apache.

You can more about this topic here: http://httpd.apache.org/docs/1.3/misc/rewriteguide.html
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote