How to keep ssl on wordpress

If you have a wordpress website and would like to vist a page in ssl and not have the links on the page be non-ssl then try the following.
*Note that the following ties into the core of wordpress meaning there is no bulky plugins doing this.
Look inside of you wp-config.php file and locate the following:

define('WP_HOME', 'http://websitename.tld'); // blog url
define('WP_SITEURL', 'http://websitename.tld'); // site url

remove it and add the following:

if($_SERVER['HTTPS']){ $connecttype = "https"; }else{ $connecttype = "http"; }
define('WP_HOME', 'http://websitename.tld.'); // blog url
define('WP_SITEURL', $connecttype.'://websitename.tld'); // site url

There you go all of you plugins and pages will stay in SSL if you enter ssl on you site at anytime.
Also try adding:

define('FORCE_SSL_ADMIN', true);

If you would like the admin part to always be in ssl.

Tags: