How do I force https? It seems to always use http? :(

I changed my config file to use SSL, but it still doesn't redirect.

6 Replies

Just use apache rewrite:

# phpMyAdmin default Apache configuration

Alias /phpmyadmin /usr/share/phpmyadmin

 <directory usr="" share="" phpmyadmin="">Options FollowSymLinks
    DirectoryIndex index.php

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*){REQUEST_URI}

    <ifmodule mod_php5.c="">AddType application/x-httpd-php .php

        php_flag magic_quotes_gpc Off
        php_flag track_vars On
        php_flag register_globals Off
        php_value include_path .</ifmodule></directory> 

doh.. I always make the dumbest mistakes.. xD

If you go through;

^ You can setup your mysql settings.

Once your done, you can do the following;

rm -rf setup # We don't need the setup folder anymore…

mv config/ # Move the saved config file.

rm -rf config # Remove the config folder.

Then it automatically resets to https mode, although sometimes it doesn't work right.. thanks for the .htaccess rewrite code :D

No need to use rewrite. You can just use Redirect. It doesn't get simpler than this! :) Here's something very similar to what I use on my linode:

 <virtualhost *:443="">ServerName

  CustomLog /var/log/apache2/ combined
  ErrorLog /var/log/apache2/
  SSLEngine on
  SSLCertificateKeyFile /etc/ssl/ssl.key/mydomain.key
  SSLCertificateFile /etc/ssl/ssl.crt/mydomain.crt
  SSLCertificateChainFile /etc/ssl/ssl.crt/</virtualhost> 
 <virtualhost *:80="">ServerName
  Redirect /</virtualhost> 

Then Apache will just autoredirect from http to https.

found a easier method, but I used some of your code to do it. I manually set a https redirect in my vhost;

# Force https:// on phpMyAdmin login.
Redirect /path/to/pma

Works great! :)

I follow instructions in

~~[" target="_blank">]( … elf-signed">](

And I don't know where the *.crt file is : (

don't forget to issue these commands:

sudo a2ensite default-ssl

enables HTTPS for your apache2 install (even though the apache2/sites-available/default-ssl file is configured for HTTPS)

and of course restart

sudo /etc/init.d/apache2 restart


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct