- Michael Barton |
- PHP, Web Development |
- December 13th, 2009
I installed yet another install of phpMyAdmin, and every time I forget how to configure it to force SSL. All phpMyAdmin installs should do this (use SSL). You never want to login without SSL unless you’re on a secured network.
2 ways to force SSL with phpMyAdmin
1) Using Apache .htaccess (this can also be put in the httpd.conf if you don’t use .htaccess files):
1 2 3 | RewriteEngine On RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^/directory(.*)$ https://%{HTTP_HOST}/directory$1 [L,R] |
Note: I don’t like this way but I this is a way some people do it.
2) Using phpMyAdmin’s config.inc.php file:
1 2 | // place this at the bottom somewhere $cfg['ForceSSL'] = true; |
