Redirect requests for the servers hostname to webmail

scristopher

Member
Dec 21, 2012
17
1
53
cPanel Access Level
DataCenter Provider
Hello, I am trying to find a way to redirect my servers hostname to the webmail login so that if someone browses to https://myhost.domain.tld it goes to https://myhost.domain.tld:2096 does anyone know of a way to do this without throwing up a ssl error? I have attempted to do a redirect in /usr/local/apache/htdocs/index.html using a html redirect to https://myhost.domain.tld:2096 and it kind of works, if you enter myhost.domain.tld in your browser it will redirect to webmail but if you use https://myhost.domain.tld the browser blows an error "ERR_SSL_VERSION_OR_CIPHER_MISMATCH", perhaps there is a different way I have missed?
 

Shood

Well-Known Member
Aug 12, 2015
82
16
133
Middle East
cPanel Access Level
Root Administrator
Have you tried: Tweak Settings -> Redirection -> Always redirect to SSL/TLS?
If enabled will redirect:
domain.tld:2095 to host.tld:2096 and domain.tld:2082 to host.tld:2083
 

scristopher

Member
Dec 21, 2012
17
1
53
cPanel Access Level
DataCenter Provider
Have you tried: Tweak Settings -> Redirection -> Always redirect to SSL/TLS?
If enabled will redirect:
domain.tld:2095 to host.tld:2096 and domain.tld:2082 to host.tld:2083
Hi thanks for the reply, it's not that redirecting from 2095 to 2096 is the issue. Really I just want any https request with no specified port number to redirect to the webmail login. I only have one domain on this server and am strictly using the server for email, no websites being hosted. So users will be using the servers hostname eg mail.mydomain.tld to access webmail. What I'm hoping is that I can simply redirect any requests to mail.mydomain.tld to webmail. So I believe the ssl redirection is working as it should because if I visit mail.mydomain.tld without specifying https it redirects perfectly to webmail using the html redirect I have placed in /usr/local/apache/htdocs/index.html. The issue is when I specify https in my browser and visit https://mail.mydomain.tld I get a ssl error.
 

scristopher

Member
Dec 21, 2012
17
1
53
cPanel Access Level
DataCenter Provider
Actually I got it figured out, the thing that was getting me was the default shared ssl certificate. Once I swapped out the default shared cert with my commercial cert all was well. Nonetheless thanks for your help!
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
Hi @scristopher

I'm glad to hear that you were able to get the issue resolved can you let us know exactly what you did to achieve this for others who may want to know as well?

Thanks!
 

scristopher

Member
Dec 21, 2012
17
1
53
cPanel Access Level
DataCenter Provider
@cPanelLauren Well I already had a wildcard ssl certificate setup for the server and was using it as the main certificate for the cpanel services (WHM -> manage service SSL Certificates), however the issue was the main "shared ssl certificate" which I completely overlooked. In whm this is under SSL/TLS -> Manage SSL Hosts. By default there is a self signed certificate in there that is used as the main shared ssl certificate, so basically anyone visiting the hostname of the server would see the self signed cert, thus when specifying https and visiting the servers hostname I was getting the error because of the self signed cert, when not specifying I was being redirected to webmail perfectly fine because of my wildcard cert. So I deleted the default shared ssl certificate here in the manage ssl hosts section and was able to choose my wildcard certificate from the dropdown menu in the section. After doing this my redirect that I placed in /usr/local/apache/htdocs/index.html redirected me perfectly with no issues.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
HI @scristopher

I see! Thank you very much for updating us with the resolution, I'm sure it'll help others who may have had the same issue. This is very much appreciated.

Thank you