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!

Redirect requests for the servers hostname to webmail

Discussion in 'General Discussion' started by scristopher, Jul 18, 2018.

  1. scristopher

    scristopher Member

    Joined:
    Dec 21, 2012
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    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?
     
  2. Shood

    Shood Well-Known Member

    Joined:
    Aug 12, 2015
    Messages:
    55
    Likes Received:
    10
    Trophy Points:
    83
    Location:
    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
     
  3. scristopher

    scristopher Member

    Joined:
    Dec 21, 2012
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    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.
     
  4. scristopher

    scristopher Member

    Joined:
    Dec 21, 2012
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    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!
     
  5. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,204
    Likes Received:
    228
    Trophy Points:
    173
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. scristopher

    scristopher Member

    Joined:
    Dec 21, 2012
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  7. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,204
    Likes Received:
    228
    Trophy Points:
    173
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice