How to redirect webmail from HTTP to HTTPS on a Linux server

Follow

Comments

13 comments

  • Avatar
    João Alves

    Hi!

     

    I've followed the solution 2.2 (Onyx) without luck.

    I've also restarted the services after the reconfigure.

    apache2.service

    nginx.service

    plesk.phpxx.fpm.service

     

    Can you help please?

  • Avatar
    João Alves

    Please ignore, I've inserted the code below, not above </virtualhost>.

     

    my bad, it's working

  • Avatar
    Lev Iurev

    @João Alves Glad to know:)

  • Avatar
    João Alves (Edited )

    Thank you for this how to !

     

    Regards

  • Avatar
    Ralph Jäger

    Adding this line works for me obtaining the Let's Encrypt certificate

    ProxyPass /.well-known/acme-challenge/ !

     

  • Avatar
    Jeffrey Zeunert

    Thank you for this article. I was able to make this redirect and experienced no downtime for my client's sites. I'm wondering, however, if creating the Plesk configuration template undid configuration changes I made probably in httpd.conf file? DirectoryIndex changed and loads html files first whereas it had been loading php files first.

     

  • Avatar
    Ivan Postnikov

    @Jeffrey Zeunert

    Hello!

    This is expected behavior.

    Applying configuration template deletes all changes done manually in Apache/Nginx configuration files.

  • Avatar
    Nucleus Inc. NOC

    I think the best solution to this would have a checkbox on the "mail settings" page for domains to enable 301 redirect when applying a SSL cert, just like there is on the "hosting settings" page.

     

    Please vote for this!

    https://plesk.uservoice.com/forums/184549-feature-suggestions/suggestions/31900489-redirect-from-http-to-https-for-secured-webmails

    it will fix all these problems without admins having to mess around in config files that could get overwritten by updates.

  • Avatar
    Christopher Smith

    In Solution 3 for Roundcube below you should really add the $config['force_https'] = true; to  /usr/share/psa-roundcube/config/config.inc.php instead so that if you do an update it won't be overwritten.

    Solution 3: Using native configuration file of Roundcube/Horde

     

    For Plesk: Roundcube webmail

    1. Connect to a Plesk server via SSH.

    2. Open the file /usr/share/psa-roundcube/config/defaults.inc.php in any text editor and change the value of "$config['force_https']" to "true":

      $config['force_https'] = true;

    3. Save the changes and close the file.

  • Avatar
    Pavel Mikhaylov

    Hi Christopher,

    Thanks for your input. I added it to the article.

  • Avatar
    Jeffrey Zeunert

    I had done this webmail redirect back in February and see that now it no longer works. I tried to redo this and am getting an error "no such file or directory" when i try to copy it to the newly created folder. Have the locations changed since this article was written?

  • Avatar
    Alisa Kasyanova

    @Jeffrey

    Please re-check the path. On the screenshot I see that you have created the /usr/local/psa/admin/conf/templates/webmail folder, not the /usr/local/psa/admin/conf/templates/custom/webmail one.

  • Avatar
    Jeffrey Zeunert

    Thank you Alisa. That worked once I created the second folder.

Please sign in to leave a comment.

Have more questions? Submit a request