Report this

What is the reason for this report?

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

Posted on November 5, 2017

Hi friends,

I have a problem when I login into phpmyadmin the URL has this format: https://domain.com:80/phpmyadmin/… 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.



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!

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.

Hi,

thanks for your anwser, I am not using this port, let me explain me, I go to my https://url.com/phpmyadmin/ where is the login form and when I pass the login I am being redirected to https://jordipiqueras.com:80/phpmyadmin/index.php?token=xxxxxxxxxxxxxxxx

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?

Hi,

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'];
           // }

Hello,

If you are using https in the URL already you do not need to use :80 at the end, simple https://domain.com/phpmyadmin 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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.