|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Force entire site HTTPS using Web.ConfigI know this can be done in IIS, and it may even be the preferred method
but can someone help me redirect every http request to https? I think it could be done in the global.asax.cs or web.config but would like to know the best way first... Thank you for any help. Curt <curt.zieg***@gmail.com> wrote in message
news:1157549973.066023.303520@d34g2000cwd.googlegroups.com... I've never found anything better than this:>I know this can be done in IIS, and it may even be the preferred method > but can someone help me redirect every http request to https? I think > it could be done in the global.asax.cs or web.config but would like to > know the best way first... http://www.codeproject.com/aspnet/WebPageSecurity_v2.asp?select=1095511&df=100&forumid=53615&exp=0 Thanks Mark,
I have this for now, I'll try that next & see if there are any differences in speed protected void Application_BeginRequest(Object sender, EventArgs e) { if (HttpContext.Current.Request.IsSecureConnection.Equals(false)) { Response.Redirect("https://" + Request.ServerVariables["HTTP_HOST"] + HttpContext.Current.Request.RawUrl); } } Mark Rae wrote: Show quoteHide quote > <curt.zieg***@gmail.com> wrote in message > news:1157549973.066023.303520@d34g2000cwd.googlegroups.com... > > >I know this can be done in IIS, and it may even be the preferred method > > but can someone help me redirect every http request to https? I think > > it could be done in the global.asax.cs or web.config but would like to > > know the best way first... > > I've never found anything better than this: > http://www.codeproject.com/aspnet/WebPageSecurity_v2.asp?select=1095511&df=100&forumid=53615&exp=0 <curt.zieg***@gmail.com> wrote in message
Show quoteHide quote news:1157555574.139109.181570@b28g2000cwb.googlegroups.com... I'm sure that will work OK for the single requirement that you have, whereas > Thanks Mark, > > I have this for now, I'll try that next & see if there are any > differences in speed > > protected void Application_BeginRequest(Object sender, EventArgs e) > { > if (HttpContext.Current.Request.IsSecureConnection.Equals(false)) > { > Response.Redirect("https://" + Request.ServerVariables["HTTP_HOST"] > + HttpContext.Current.Request.RawUrl); > } > } WebPageSecurity.dll forces individual folders and files to be secure or not
Other interesting topics
WAP, VS2005 keeps changing my user control types!!
CSS examples Howto inherit from an exisiting webcontrol in VS 2005 Intellisense with web.config registration of controls Page hang after updating web.config Help, NullReferenceException ASP.net using old version of DLLs Multiple Page Tiff Making New web site by using ASP.Net 2005 ASP.NET Validation control generates javascript error |
|||||||||||||||||||||||