How to enable SSL for a directory?

Cheetoz

[H]ard|Gawd
Joined
Mar 3, 2003
Messages
1,972
I am running debian etch and apache2. I believe I have apache2 setup for SSL being 'webmin' is using it. But I do not know how to set up SSL for specific directories. ex: I want to enable SSL for phpmyadmin.

thanks/

edit: nm. When following the guide, I had forgotten to remove the directory from the port 80 virtual host, so it wasn't working.
 
I don't think you can do SSL per-directory, I think its per-site.
 
Correct ... SSL certificates are tied to the domain name and the physical server, not a web folder.

If you want to force SSL on some specific folders, then you can use some custom PHP code to force a redirection to HTTPS if HTTP is used before displaying the challenge form for phpMyAdmin.
 
Along with using some custom PHP code to force a redirection to HTTPS if HTTP you can also try making phpMyadmin as subdomain and then you can apply SSL for this subdomain.
 
If the server is running apache you can use apaches config files (or a .htaccess in the directory) to force HTTPS if you have mod_rewrite enabled.

Code:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
 
Back
Top