I wanted to give a subdomain for each members profile page on a site. The few lines of rewrite code beneath was written to redirect the subdomain to the relelvant username's profile page, but dunno why it doesn't work, keep coming up with page not found errors when going to subdomain:
RewriteCond %{HTTP_HOST} ^([^.]+)\.domain\.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^([^.]+)\.domain\.com(.*) /perl/members.cgi?user=$1 [L]
RewriteCond %{HTTP_HOST} ^([^.]+)\.domain\.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^([^.]+)\.domain\.com(.*) /perl/members.cgi?user=$1 [L]