Correctly replacing a string with another string
<p>I am work a site that was coded in c# and uses a ssl cert "secure.mydomain.com
To switch from http to https it uses the following code</p>

<pre><code>       if (useSsl)
        {
            if (!String.IsNullOrEmpty(ConfigurationManager.AppSettings["SharedSSL"]))
            {
                //shared SSL
                result = ConfigurationManager.AppSettings["SharedSSL"];
            }
            else
            {
                //SSL
               **result = result.Replace("http:/", "https://");**
            }
</code></pre>

<p>This will switch from "http://mydoman.com" to "https://mydomain.com", but I need "https://secure.mydomin.com".  If I change the code to  <strong>result = result.Replace("http:/", "https://secure");</strong> it takes me to an error page because it is trying to go to "https://secure".</p>

<p>I have been searching for 3 weeks to find a solution and tried so of them but none worked.  Any suggestions on how to correct this?</p>
