Redirect to a secure HTTPS page using web.config without an absolute URL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kmithu
    New Member
    • Jun 2007
    • 11

    Redirect to a secure HTTPS page using web.config without an absolute URL

    I have a web site where I want to make the pages secures.ie. I want to redirect my pages to https.I have tried this doing so by making a self signed certificate and using response.redire ct("https://myWebsite/SecuredPage.asp x") and it ran out well.

    But my problem is that I want to do this through the web.config file so that even if i want to secure full site or any particular page, I am able to do so at any time.
    Using the concept of switch protocol, my program debugged once. But now its not running. Please help me out with this. Also Is there any way to do this without having to put the absolute address. And also, when I am finished with the secure pages, how do I go back to non-secure? Will that be just by entering the address again just as http:// ?
    Last edited by kmithu; Jun 19 '07, 11:36 AM. Reason: general
  • nateraaaa
    Recognized Expert Contributor
    • May 2007
    • 664

    #2
    Originally posted by kmithu
    I have a web site where I want to make the pages secures.ie. I want to redirect my pages to https.I have tried this doing so by making a self signed certificate and using response.redire ct("https://myWebsite/SecuredPage.asp x") and it ran out well.

    But my problem is that I want to do this through the web.config file so that even if i want to secure full site or any particular page, I am able to do so at any time.
    Using the concept of switch protocol, my program debugged once. But now its not running. Please help me out with this. Also Is there any way to do this without having to put the absolute address. And also, when I am finished with the secure pages, how do I go back to non-secure? Will that be just by entering the address again just as http:// ?
    If you want the url stored in the web.config file you will need to store it as an absolute address. If you want multiple addresses to be used in your application you will need to create several keys in your web.config for all of the possible urls that you want to call. As for making the page non-secure again just call http://url instead of https://url. Hope this helps.

    Nathan

    Comment

    Working...