<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Steps to convert your http page to https:' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Steps to convert your http page to https:' posted on the 'HTML &amp; WEB-Design' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2012 Programmers Heaven</copyright>
    <pubDate>Wed, 23 May 2012 15:18:37 -0700</pubDate>
    <lastBuildDate>Wed, 23 May 2012 15:18:37 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Steps to convert your http page to https:</title>
      <link>http://www.programmersheaven.com/mb/html/412206/412206/steps-to-convert-your-http-page-to-https/</link>
      <description>Use the following code in your index or home page of application.&lt;br /&gt;
&lt;br /&gt;
string strURL = Request.Url.ToString();&lt;br /&gt;
Array arrURL = strURL.Split('/');&lt;br /&gt;
string strHttpPath;&lt;br /&gt;
string strHttpsPath;&lt;br /&gt;
Array arrHttpPath;&lt;br /&gt;
strHttpPath = "http://" + arrURL.GetValue(2).ToString() + Request.ApplicationPath;&lt;br /&gt;
strHttpsPath = "https://" + arrURL.GetValue(2).ToString() + Request.ApplicationPath;&lt;br /&gt;
arrHttpPath = strHttpPath.ToCharArray();&lt;br /&gt;
if (arrHttpPath.GetValue(strHttpPath.Length - 1).ToString() == "/")&lt;br /&gt;
{&lt;br /&gt;
    strHttpPath = strHttpPath.Substring(0, strHttpPath.Length - 1);&lt;br /&gt;
    strHttpsPath = strHttpsPath.Substring(0, strHttpsPath.Length - 1);&lt;br /&gt;
}&lt;br /&gt;
//Session["HttpPath"] = strHttpPath; //When http path is required uncomment it and use this session value while redirecting it to other page.&lt;br /&gt;
Session["HttpsPath"] = strHttpsPath;&lt;br /&gt;
&lt;br /&gt;
Now use Response.Redirect method in following way.&lt;br /&gt;
&lt;br /&gt;
Code&lt;br /&gt;
&lt;br /&gt;
Response.Redirect(Session["HttpsPath"].ToString() + "/Contents/ThankYou.aspx");&lt;br /&gt;
&lt;br /&gt;
Note: My Thankyou page is located inside Contents folder. &lt;br /&gt;
&lt;br /&gt;
Incase of using javascript to redirect the page, follow the below code&lt;br /&gt;
&lt;br /&gt;
location.href = '&amp;lt;%=Session["HttpsPath"].ToString()%&amp;gt;' + "/Contents/ ThankYou.aspx ";&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.clickssl.com"&gt;http:www.clickssl.com&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/html/412206/412206/steps-to-convert-your-http-page-to-https/</guid>
      <pubDate>Fri, 22 Jan 2010 22:27:29 -0700</pubDate>
      <category>HTML &amp; WEB-Design</category>
    </item>
  </channel>
</rss>
