Try this to make webmail.domain.com to work :
1. Create an ‘A’ record for the sub-domain ‘webmail’ in the DNS zone file. It should look like :
Code:
domain.com. IN A XX.XX.XXX.XXX
localhost.domain.com. IN A 127.0.0.1
domain.com. IN MX 0 domain.com.
mail IN CNAME domain.com.
www IN CNAME domain.com.
ftp IN A XX.XX.XXX.XXX
cpanel IN XX.XX.XXX.XXX
whm IN A XX.XX.XXX.XXX
webmail IN A XX.XX.XXX.XXX
webdisk IN A XX.XX.XXX.XXX
2. Put the following code inside .htaccess in the sub-domain folder ( virtual sub-domain which doesn’t have an entry in httpd.conf
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail.domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.webmail.domain.com$
RewriteRule ^.*$ “http\:\/\/domain\.com\/webmail” [R=301,L]
To prevent forwarding of ‘/webmail’ to cPanel’s webmail interface , follow the steps below :
1. Open /usr/local/cpanel/APACHE_CONFIG in your favorite editor.
2. Find the lines that reference /webmail
3. Add the following to the beginning of each line that contains /webmail:
*REMOVE*
( Make certain there is a space after the final * )
4. Save your changes and exit the editor
5. Execute /scripts/check_cpanel_apache_aliases
Users can still access cPanel's webmail via ports 2095/96