CMSMS Admin over SSL

A quick tutorial/reference on how to setup SSL for the administration panel of CMS Made Simple (CMSMS) …
Update
A major update to CMS Made Simple v1.10 “Martinique” was released on Oct 22, 2011, just 2 days after this blog post was originally posted. As of this new release, just update your “config.php” file to the following:
#$config['admin_dir'] = 'admin';
$config['admin_url'] = 'https://www.YOURDOMAIN.com/admin';
Many thanks to Cristopher Daniluk for pointing this out!
Add/Edit .htaccess File (v1.9.4.2 and earlier)
In your root admin directory, add the following to your .htaccess file. This will force all access to the admin directory to load via SSL with an “https://” prefix:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Update config.php (v1.9.4.2 and earlier)
Update your path settings in the root “config.php” file (as of CMS Made Simple v1.9.4.2 “Faanui”), by commenting out the $config['root_url'] and $config['ssl_url'] and adding the following just below them, making sure to replace YOURDOMAIN with your domain:
#-------------
#Path Settings
#-------------
#Document root as seen from the webserver. No slash at the end
#If page is requested with https use https as root url
#e.g. http://blah.com
#$config['root_url'] = 'http://www.YOURDOMAIN.com';
#SSL URL. This is used for pages that are marked as secure.
#$config['ssl_url'] = 'https://www.YOURDOMAIN.com';
$config['root_url'] = 'http://www.YOURDOMAIN.com';
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') {
$config['root_url'] = 'https://www.YOURDOMAIN.com';
}
GOOD LUCK!

Wee Little Grasshopper


CMSMS 1.10 will have built in capabilities for SSL… just specify an https:// prefix for the admin_url.
Great news!
In one of my websites I have CMSMS 1.10.3 installed.
Unfortunately, your solution does not work in my case.
in config file I have
$config['admin_dir'] = ‘https://www.MyDomain.com/admin’;
And when I open this URL, I get hundreds of such errors:
Warning: opendir(/unix/path/to/website/files/https://www.MyDomain.com/admin//lang) [function.opendir]: failed to open dir: No such file or directory in /home/personality/www/www/lib/translation.functions.php on line 88
Any idea why it is not working? Thank you!
Hi Augustas,
Have you verified that all file/directory locations are correct? I notice that within the error message there are 2 “//” between “admin” and “lang” in the location hierarchy.
I would recommend first going through all of the config.php details to ensure these locations are pointed correctly and see if you continue to get this error.
Good luck!
Edward