I assume you're making these subdomain redirections because you want to enforce SSL connections.
By default, the mail
, webmail
, whm
and cpanel
subdomains are reserved by cPanel. These subdomains are used to present visitors with a login screen for the related service. The mail
subdomain points to the main server IP by default, this one is used to configure email clients.
cPanel also allows you to either:
- Disable these proxy subdomains (as they're called) entirely,
- Disable creation of these subdomains in DNS, or
- Allow users to override these proxy subdomains with their own settings.
If you use these subdomains to simply redirect users to the correct login page for the service, make sure to enable proxy subdomains and proxy subdomain creation in WHM > Server Configuration > Tweak Settings
I can see that you're trying to redirect users to the SSL-secured versions of the login pages, you can try any of the following solutions:
- Don't touch the subdomains from cPanel. Users should automatically be presented with a login page. If you enforce SSL here, users will be presented with the SSL certificate installed on that service.
- Have users visit
<domain>/whm
, <domain>/cpanel
or <domain>/webmail
. cPanel will offer them the choice to use a secure or insecure connection. This behavior can be tweaked in the Redirection
tab of Tweak Settings
. If the domain has a valid SSL certificate, this can be offered to them when visiting this page. (I believe this was introduced in cPanel version 60)
- Have users visit
<hostname>:2083
for cPanel, <hostname>:2096
for webmail or <hostname>:2087
for WHM. These are the secure versions of all services. Users will be presented with an SSL certificate for the server hostname. Subtract 1 from a port number to use the insecure version instead.
cPanel recently changed how service SSL certificates are managed. Have a look at the documentation for more info. It boils down to that you can install your own certificate or they generate and sign one for you if you don't have one.
As far as I know, you can't install a different certificate for the service ports on other domains. There's just one global SSL certificate for all services across all domains on the server. I do believe that this is a feature they plan on implementing in the future.
TL;DR: You probably shouldn't overwrite the proxy subdomains (mail.
, cpanel.
, whm.
, webdisk.
, calendar.
) in cPanel, since cPanel already handles redirects for them. If you want a secure connection, you can visit <domain>/cpanel
(or /whm
or /webmail
) to either let users choose where to go, or automatically redirect them to <domain>:2083
, :2087
or :2096
. This can be tweaked in the Redirection
tab in Tweak Settings
Proxy subdomains currently only present the server hostname certificate, so beware of certificate errors when visiting them from other domains.
EDIT: found the feature request
Subdomains
or from the WHM interfaceSetup/Edit Domain Forwarding
? I believe the cPanel interface requires you to separately setup forwarding for the www and non-www subdomain.mail
,webmail
,whm
orcpanel
, do they?