Welcome to Dream.In.Code
Become an Expert!

Join 150,052 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,713 people online right now. Registration is fast and FREE... Join Now!




Request.UrlReferrer.AbsoluteUri losing HTTPS navigation

 
Reply to this topicStart new topic

Request.UrlReferrer.AbsoluteUri losing HTTPS navigation

TheMatrix
15 Feb, 2008 - 04:47 AM
Post #1

New D.I.C Head
*

Joined: 15 Feb, 2008
Posts: 14

Hi All,

I am facing a weird problem with HTTPS and Request.Url.AbsoluteUri in my
ASP.NET application. Here is the scenario -
1. I have a page call Authentication.aspx using this URL https://NHWB032/ClientAccount/EN/Authentication.aspx
On the page i have a menu that enables you to navigate to the same page but in a different language (French).

When clicking the language link i navigate to http://NHWB032/ClientAccount/FR/Authentication.aspx

and i am using Request.Url.AbsoluteUri to know on which page i am since i have more than 1 page containing the language menu.

If you notice between the 2 links Request.Url.AbsoluteUri got change from HTTPS to HTTP

PROBLEM - the result has HTTP instead of HTTPS!!!!!

Has anybody faced a similar problem or has some insight into what could be
going wrong and could anybody give me the best resolution to this problem i.e.:Change the code, Change settings on the server and IIS.etc.?

Thanks for your help!

User is offlineProfile CardPM
+Quote Post

Jayman
RE: Request.UrlReferrer.AbsoluteUri Losing HTTPS Navigation
15 Feb, 2008 - 12:26 PM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,319



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
Post the code that is relevant to when you change languages.

Are you using a Redirect to change to the French page?

Without showing your code it is difficult to say exactly why are having this issue.
User is offlineProfile CardPM
+Quote Post

TheMatrix
RE: Request.UrlReferrer.AbsoluteUri Losing HTTPS Navigation
15 Feb, 2008 - 02:05 PM
Post #3

New D.I.C Head
*

Joined: 15 Feb, 2008
Posts: 14

Yes i am using a Redirect to the French page.

Here is my code but since our servers got change to Windows Server 2003, i am getting this problem. Could it be a configuration in IIS?

CODE
Private Sub Button_Language_Change_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_Language_Change.Click
'Could be more than 1 page passing here
Dim redirectURL As String = Request.UrlReferrer.AbsoluteUri.Replace("/EN", "/FR")
Response.Redirect(redirectURL)
End Sub


When redirecting, in the address bar i saw the HTTPS but the UrlReferrer.AbsoluteUri eliminates it by putting HTTP on the french page.

QUOTE(jayman9 @ 15 Feb, 2008 - 01:26 PM) *

Post the code that is relevant to when you change languages.

Are you using a Redirect to change to the French page?

Without showing your code it is difficult to say exactly why are having this issue.

User is offlineProfile CardPM
+Quote Post

Jayman
RE: Request.UrlReferrer.AbsoluteUri Losing HTTPS Navigation
15 Feb, 2008 - 04:53 PM
Post #4

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,319



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
It is most likely the configuration of IIS.

Do you have a signed certificate installed in IIS and is it configured properly?
User is offlineProfile CardPM
+Quote Post

TheMatrix
RE: Request.UrlReferrer.AbsoluteUri Losing HTTPS Navigation
16 Feb, 2008 - 05:35 AM
Post #5

New D.I.C Head
*

Joined: 15 Feb, 2008
Posts: 14

Thanks for the reply,

I would need to check with a server group on monday to see if its well configure since another group takes care of configuring the server (I have no power).

Do you think by NOT configuring well folders or Web Site to use SSL/HTTPS would create that kind of problem for the Request.Url.AbsoluteUri losing the HTTPS?

I know i can force things with my code
i.e.: Request.UrlReferrer.AbsoluteUri.Replace("http", "https")

but i never got this problem before using the Windows 2003 servers,

Do you know what i could look for in IIS that would make the UrlReferrer behave like this?

Thanks again

User is offlineProfile CardPM
+Quote Post

TheMatrix
RE: Request.UrlReferrer.AbsoluteUri Losing HTTPS Navigation
16 Feb, 2008 - 12:06 PM
Post #6

New D.I.C Head
*

Joined: 15 Feb, 2008
Posts: 14

Hi guys,

Everywhere i mention: Request.UrlReferrer.AbsoluteUri

I meant Request.Url.AbsoluteUri!

Sorry

Thanks

The Matrix

User is offlineProfile CardPM
+Quote Post

Jayman
RE: Request.UrlReferrer.AbsoluteUri Losing HTTPS Navigation
16 Feb, 2008 - 12:35 PM
Post #7

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,319



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
QUOTE(TheMatrix @ 16 Feb, 2008 - 05:35 AM) *

Do you know what i could look for in IIS that would make the UrlReferrer behave like this?

Thanks again


Here are the steps for installing the certificate and setting up SSL on Server 2003. Check that last two sections for instructions on where in IIS to look for a correct set-up.
http://support.microsoft.com/kb/299875
User is offlineProfile CardPM
+Quote Post

TheMatrix
RE: Request.UrlReferrer.AbsoluteUri Losing HTTPS Navigation
20 Feb, 2008 - 01:06 PM
Post #8

New D.I.C Head
*

Joined: 15 Feb, 2008
Posts: 14

The fix we came up with is to put this line of code:

redirPath.Replace("http://", "https://")

QUOTE(jayman9 @ 16 Feb, 2008 - 01:35 PM) *

QUOTE(TheMatrix @ 16 Feb, 2008 - 05:35 AM) *

Do you know what i could look for in IIS that would make the UrlReferrer behave like this?

Thanks again


Here are the steps for installing the certificate and setting up SSL on Server 2003. Check that last two sections for instructions on where in IIS to look for a correct set-up.
http://support.microsoft.com/kb/299875


User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 10:18PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month