How can I redirect the phpmyadmin login on apache to port 443 instead of 80?

Hi friends,

I have a problem when I login into phpmyadmin the URL has this format:… then the login redirect page is wrong and show me an error: “ERR_SSL_PROTOCOL_ERROR”

How Can I redirect to 443 instead of 80?

Thanks for your help.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


Go to libraries/Config.class.php

find below code

// Add hostname
            $pma_absolute_uri .= $url['host'];
            // Add port, if it not the default one
           if (! empty($url['port'])
                && (($url['scheme'] == 'http' && $url['port'] !=80)
                || ($url['scheme'] == 'https' && $url['port'] != 443))
                $pma_absolute_uri .= ':' . $url['port'];

delete/disable this function

// Add hostname
            $pma_absolute_uri .= $url['host'];
            // Add port, if it not the default one
           // if (! empty($url['port'])
           //     && (($url['scheme'] == 'http' && $url['port'] != 80)
           //     || ($url['scheme'] == 'https' && $url['port'] != 443))
           // )
        //      {
          //      $pma_absolute_uri .= ':' . $url['port'];
           // }


thanks for your anwser, I am not using this port, let me explain me, I go to my where is the login form and when I pass the login I am being redirected to

Then I can’t see this new page because the URL is not being resolved (https with port 80 seems wrong)…

Then if I change the ‘80’ for ‘443’ in the url of the browser the redirect has success but how can I automatize this?


If you are using https in the URL already you do not need to use :80 at the end, simple should work.

Please check your Apache configuration for that specific domain, is the vhost entry for the port 443 is there with SSL cert entries.