471,350 Members | 1,835 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,350 software developers and data experts.

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

11
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.redirect("https://myWebsite/SecuredPage.aspx") 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:// ?
Jun 19 '07 #1
1 2467
nateraaaa
663 Expert 512MB
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.redirect("https://myWebsite/SecuredPage.aspx") 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
Jun 19 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by Brian Henry | last post: by
2 posts views Thread by Sergej Prokoviev | last post: by
7 posts views Thread by =?Utf-8?B?YzY3NjIyOA==?= | last post: by
2 posts views Thread by RuthC | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.