I'll answer my own question
In Page_load
Response.Buffer = true;
if(Request.ServerVariables["HTTPS"].Equals("off"))
{
String redirect = "", queryString = "";
redirect = "https://" + Request.ServerVariables["SERVER_NAME"] +
Request.ServerVariables["SCRIPT_NAME"];
queryString = Request.ServerVariables["QUERY_STRING"];
if(!queryString.Equals(""))
redirect += "?" + queryString;
Response.Redirect(redirect);
}
To reverse that (go from https to http) just switch the first if statment to
on, and assign redirect to http instead of https
--
Steve Evans
Email Services
SDSU Foundation
(619) 594-0708
"- Steve -" <se****@foundation.sdsu.edu> wrote in message
news:u5*************@tk2msftngp13.phx.gbl...
If a user where to go to http://server/page.aspx I want to force them over
to https://server/page.aspx. So those that didn't catch the subtle hint
there, I want to move them over to the SSL page.
What's the best way to handle that? I know I can have IIS block access to
a page if it's not over HTTPS, but I just want to seamlessly move them to
the HTTPS space.
I was thinking I could Response.Redirect() on the page load, but that just
doesn't seem right.
--
Steve Evans
Email Services
SDSU Foundation
(619) 594-0708