webmail subdomain on all new account

herbertjoei

Member
Aug 9, 2005
20
0
151
Hi,

Is there a way to have cpanel create a webmail.domain.com subdomain on all new accounts and automatically configure it to redirect to www.domain.com/webmail?

I know I can create a webmail subdomain and create a redirect to it manually on every site I create but I want it to be automatic.

So far, what I have done is to edit the DNS template to contain webmail as A record so that there would be a webmail subdomain.

I think I should be adding a /webmail to the public_html with some redirect rule on the skeleton but i'm not really sure how to do this.

Can somebody help? Thanks.

Herbert
 

lostinspace

Well-Known Member
Jul 19, 2003
122
1
168
Colorado Springs, CO
You'll want to create a 'webmail' dirictory within the skeleton directory and add an .htaccess file to the directory with the following:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail.domain.com$
RewriteRule ^(.*)$ http://domain.com/webmail [R=301,L]
I guess I just realized the problem with this while I typed the reply (how can you specify the resellers domain automatically??).
 

herbertjoei

Member
Aug 9, 2005
20
0
151
That is exactly my problem. Unlike the DNS template, there's a variable that can be substituted for the actual domain.

Thanks for replying!