How to Force SSL for the WordPress Dashboard

You can force SSL for only your WordPress Dashboard and administrator login page.

SFTP into your server as your WordPress app's system user and open your WordPress app's wp-config.php file.

Immediately before the line /* That's all, stop editing! Happy blogging. */, add the following:

define('FORCE_SSL_ADMIN', true);
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
ServerPilot makes it easy for you to force SSL sitewide without needing to edit your .htaccesfile.