CMSMS Admin over SSL

Published on November 2, 2011
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!

Leave a Comment

Return to Top
"Painting is easy when you don't know how, but very difficult when you do"
- Edgar Degas