472,146 Members | 1,280 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Enforcing https.

Hello gurus,

We have a site that need security upgrade to run over https.
We want people to be redirected to https:oursite when the type what the
know, http:oursite.

Is this possible?
How?
mnay thanks
JJ
Dec 11 '06 #1
4 1108
"Jens Jensen" <jj@jensen.dkwrote in message
news:uH******************@TK2MSFTNGP04.phx.gbl...
Is this possible?
Yes.
How?
Several ways:

1) AFAIK, you can set it in IIS

2)

protected void Application_BeginRequest(Object sender, EventArgs e)
{
if (HttpContext.Current.Request.IsSecureConnection.Eq uals(false))
{
Response.Redirect("https://" + Request.ServerVariables["HTTP_HOST"]
+ HttpContext.Current.Request.RawUrl);
}
}

3)
http://www.codeproject.com/aspnet/We...id=53615&exp=0
Dec 11 '06 #2
Hi Mark and thank you for your quick response.

solution 2) looks very elegant, but could you provide more detail on 1).

2) require a new build and upload which we cant afford right now due to
heavy load.
many thanks
JJ
Dec 11 '06 #3
"Jens Jensen" <jj@jensen.dkwrote in message
news:eg**************@TK2MSFTNGP03.phx.gbl...
solution 2) looks very elegant, but could you provide more detail on 1).
http://www.google.co.uk/search?sourc...https+redirect
Dec 11 '06 #4
http://www.google.co.uk/search?sourc...https+redirect
>
Great great,
Many thanks
JJ
Dec 11 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by kiran | last post: by
2 posts views Thread by Craig Keightley | last post: by
16 posts views Thread by Paul Sweeney | last post: by
3 posts views Thread by Xamle Eng | last post: by
12 posts views Thread by Grunff | last post: by
14 posts views Thread by Peter Chant | last post: by
1 post views Thread by Groove | last post: by
reply views Thread by leo001 | 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.