0

I think i am missing something in https...

Currently i am using this to redirect the desired page from http to https

  If Not Request.IsSecureConnection Then
  Dim serverName As String = HttpUtility.UrlEncode(Request.ServerVariables("SERVER_NAME"))
  Dim filePath As String = Request.FilePath
  Response.Redirect(("https://" & serverName) + filePath)
  End If

Should i declare somewhere in the web.config the absolut links for https?

p.s. My links are relative

OrElse
  • 9,709
  • 39
  • 140
  • 253

2 Answers2

0

You can write an HttpModule and add it to the web.config.

Community
  • 1
  • 1
jinsungy
  • 10,717
  • 24
  • 71
  • 79
0

If you want to use a static URL then you can add this in your web config:

<appSettings>
    <add key="url" value="http://www.yoursite.com" />
</appSettings>

And after that you can get that value where ever you want like this:

string strHost = ConfigurationManager.AppSettings.Get("url").ToString();

Hope this will solve your problem.

Mat
  • 202,337
  • 40
  • 393
  • 406
ishwor
  • 1