Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

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.

Change default subdomain for webmail to mail

Discussion in 'General Discussion' started by Scottnl, Oct 14, 2014.

  1. Scottnl

    Scottnl Registered

    Joined:
    Oct 14, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hallo All,

    This is my first post and straight away it's a question. By default the subdomain webmail.domain.com redirects to the email services. Is there any way to change this to mail.domain.com. The same goes for cpanel and whm. Ive looked everywhere but could not find anything on this matter.

    Scott
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello :)

    These entries are stored in the following file:

    Code:
    /var/cpanel/templates/apache2/main.default
    You will need to copy this file to the following name:

    Code:
    /var/cpanel/templates/apache2/main.local
    Note that the "apache2" part of the path may change, depending on the version of Apache installed on your system. Next, edit the newly copied local file to the modified values of your preference, save the file, and run the following commands:

    Code:
    /usr/local/cpanel/bin/apache_conf_distiller --update
    /usr/local/cpanel/bin/build_apache_conf
    /scripts/restartsrv_httpd
    Thank you.
     
  3. Scottnl

    Scottnl Registered

    Joined:
    Oct 14, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thanks Michael for your answer.

    I copied the file to main.local. There are a few places that you can replace webmail. Do you replace all of them or just the ones in the RewriteCond?

    I'm pretty new to Cpanel and don't want to make mistakes.

    Scott
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Yes, you must update the Rewrite rules and the ServerAliases entries to the updated names of your choosing.

    Thank you.
     
  5. Scottnl

    Scottnl Registered

    Joined:
    Oct 14, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I replaced webmail to mail and cpanel to server.

    I also ran these scripts

    Code:
    /usr/local/cpanel/bin/apache_conf_distiller --update
    /usr/local/cpanel/bin/build_apache_conf
    /scripts/restartsrv_httpd
    
    I am still redirected to default webpage. Am i missing something?
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    It's likely you did not correctly edit the /var/cpanel/templates/apache2/main.local file. Could you provide an example of the changes you made?

    Thank you.
     
Loading...

Share This Page