My Wordpress directory is at www.example.com/blog
I recently changed my entire site to force HTTPS. So my .htaccess file in /blog/ looks like this:
You can also add these two lines to the wp-config.php
define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);
So you could easily make conditions for http for dev environment and https for live like so:
if(strpos($_SERVER['HTTP_HOST'], 'livedomain.com') !== FALSE){
define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);
} else {
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);
}