Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsFeedbackFeedbackSsl and Captcha?Ssl and Captcha?
Previous
 
Next
New Post
8/24/2007 10:36 AM
 

dkarantonis wrote

Hi Sanjay,

I have tried the code mentioned above many times and is seems like, when the DNN is loaded, the default page keeps refreshing all the time (the code goes to the 'Else' segment of the IF-ELSE IF-ELSE-END IF statement). So, the DNN keeps refreshing the default page ... forever.

I have also tried to enter the following code (note that the difference with the above code is that the "captha" search is performed on na outer IF-ENDIF statement):

                    If strURL.ToLower.Contains("captcha.aspx") Then
                        'Don't do anything since this is a captcha URL
                        If strURL.ToLower.StartsWith("https://") Then
                            ' redirect to secure connection
                            Response.Redirect(strURL, True)
                        Else ' when switching to an unsecure page, use a clientside redirector to avoid the browser security warning
                            Response.Clear()
                            ' add a refresh header to the response
                            Response.AddHeader("Refresh", "0;URL=" & strURL)
                            ' add the clientside javascript redirection script
                            Response.Write("")
                            Response.Write("")
                            Response.Write("")
                            ' send the response
                            Response.End()
                        End If
                    End If

and now i am losing the https redirect on my SSL enabled (IsSecure = yes) pages.

Is there something i am doing wrong, or is there some issue concerning the code?

regards

 

Looks like you put the if loop in the wrong place. 
Here's the whole block of code

 ' if a protocol switch is necessary
                    If strURL <> "" Then
                     If strURL.ToLower.Contains("captcha.aspx") Then
                        'Don't do anything since this is a captcha URL
                        Else If strURL.ToLower.StartsWith("https://") Then
                            ' redirect to secure connection
                            Response.Redirect(strURL, True)
                        Else ' when switching to an unsecure page, use a clientside redirector to avoid the browser security warning
                            Response.Clear()
                            ' add a refresh header to the response
                            Response.AddHeader("Refresh", "0;URL=" & strURL)
                            ' add the clientside javascript redirection script
                            Response.Write("<html><head><title></title>")
                            Response.Write("<!-- <script language=""javascript"">window.location.replace(""" & strURL & """)</script> -->")
                            Response.Write("</head><body></body></html>")
                            ' send the response
                            Response.End()
                        End If
                    End If


AcuitiDP - Oracle Data Provider for DotNetNuke
 
New Post
8/24/2007 12:15 PM
 

Hi Sanjay,

thanx for the quick response.

You are correct. The code works fine.

I' ve just forgotten to write the outer If strURL <> "" Then - End If. statement.

Now everything works as expected.

Ari, i will send you the rebuilt assembly.

 
New Post
8/29/2007 9:49 AM
 

Hi,

Thank you for you help. Can you give me a link for a download so I can copy-past the recompiled dll? Could you also paste the complete code once more so that the bugfixes are put forward more clearly?

Thank you!

J.

 
New Post
8/29/2007 11:36 AM
 

Hi Jelle,

Open the DNN solution of your DNN instance.

the code change should be performed inside the "URLRewriteModul.vb" file of the DotNetNuke.HttpModules.UrlRewrite project.

Inside the function 'OnBeginRequest()', go to line 348 and replace the if statement block that already exists with this one:

                    ' if a protocol switch is necessary
                    If strURL <> "" Then
                        If strURL.ToLower.Contains("captcha.aspx") Then
                            'Don't do anything since this is a captcha URL
                        ElseIf strURL.ToLower.StartsWith("https://") Then
                            ' redirect to secure connection
                            Response.Redirect(strURL, True)
                        Else ' when switching to an unsecure page, use a clientside redirector to avoid the browser security warning
                            Response.Clear()
                            ' add a refresh header to the response
                            Response.AddHeader("Refresh", "0;URL=" & strURL)
                            ' add the clientside javascript redirection script
                            Response.Write("<html><head><title></title>")
                            Response.Write("<!-- <script language=""javascript"">window.location.replace(""" & strURL & """)</script> -->")
                            Response.Write("</head><body></body></html>")
                            ' send the response
                            Response.End()
                        End If
                    End If

Then rebuild the DNN solution.

If, for any reason, building the DNN solution is not an option, send me your e-mail address and i' ll send you the rebuilt "DotNetNuke.HttpModules.UrlRewrite.dll" assembly file. You then replace the file with the old one located under the <Your DNN Installation path>\Website\bin folder.

 I have tried it both ways and it works as expected.

regards,

Dimitris

 
New Post
8/29/2007 12:01 PM
 

Hi Dimitris,

Thank you very much for your dll. It works fine!

Jelle

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsFeedbackFeedbackSsl and Captcha?Ssl and Captcha?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out