How can I make links start with https:// when my blog is accessed over an ssl-secured connection, and http:// otherwise?
I've made my site available with and without ssl. The same content is available either way, but visitors have the option to use ssl encryption if they want to (e.g. if accessing the site from work). I consider this an important feature.
If someone visits http://myblog.com/ all the links generated by WordPress (permalinks, pages, archives, etc.) look like http://myblog.com/content. The problem is, if someone visits https://myblog.com/ the permalinks still look like http://myblog.com/permalink. Visitors to https://myblog.com/ will expect links to content in my blog to be ssl secured will be surprised to find that they are not.
I'm aware that I could use mod_rewrite to redirect all those http:// links to https:// links, but this would inconvenience visitors who don't want to use ssl. So, how can I get WordPress to generate https:// links when accessed over an ssl connection and http:// links otherwise?