The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

webmail subdomain on all new account

Discussion in 'E-mail Discussions' started by herbertjoei, Nov 28, 2006.

  1. herbertjoei

    herbertjoei Member

    Joined:
    Aug 9, 2005
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  2. lostinspace

    lostinspace Well-Known Member

    Joined:
    Jul 19, 2003
    Messages:
    122
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    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??).
     
  3. herbertjoei

    herbertjoei Member

    Joined:
    Aug 9, 2005
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    That is exactly my problem. Unlike the DNS template, there's a variable that can be substituted for the actual domain.

    Thanks for replying!
     
  4. lostinspace

    lostinspace Well-Known Member

    Joined:
    Jul 19, 2003
    Messages:
    122
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Colorado Springs, CO
    Well, not the ideal fix but you can supply your reseller domain as the domain. This will work for any non dedicated IPs.
     
Loading...

Share This Page