Request.Url.GetLeftPart(UriPartial.Authority) - strange results

Tech-Archive recommends: Fix windows errors by optimizing your registry



I'm having a problem on an ASP.NET 1.1 web site. The page where I'm having
a problem is accessed without SSL. It contains a link to another page which
can be configured to require SSL. If SSL is required, I change the URL of
the link from a relative URL to an absolute URL with HTTPS something like
this:

string newUrl =
Request.Url.GetLeftPart(UriPartial.Authority).Replace("http://","https://";)
+ Response.ApplyAppPathModifier("/MyApp/Secure/MyPage2.aspx");

The GetLeftPart(UriPartial.Authority) is returning a completely different
domain name from the domain in the request:

The Request address is like http://www.MyCompany.org/MyApp/Page1.aspx.

The GetLeftPart expression is returning something like:

https://www.MyCompanysOtherSite.org/MyApp/Secure/Page2.aspx.

If I enabling Trace for the www.MyCompany.org site, the trace information
says the server variable SERVER_NAME is www.MyCompanysOtherSite.org . There
is no reference in the application whatsoever to MyCompaniesOtherSite.org.

So it appears to me that there's something incorrect in the setup of the
MyCompany.org site, but this is beyond my expertise to explain or fix.

How does GetLeftPart(UriPartial.Authority) work, is it the wrong concept
here, what's happening?

Tim W.




.



Relevant Pages

  • Re: SSL broken after Windows 2003 upgrade
    ... The svchost.exe you reference is "IIS". ... routes them to the appropriate w3wp.exe based on configuration from WAS ... WFetch can make both a normal SSL request as well as a Client-Certificate ...
    (microsoft.public.inetserver.iis)
  • Re: SSL broken after Windows 2003 upgrade
    ... > routes them to the appropriate w3wp.exe based on configuration from WAS ... > WFetch can make both a normal SSL request as well as a Client-Certificate ... SSL Diag tells you that SSL should be working assuming the website ...
    (microsoft.public.inetserver.iis)
  • Re: Change public domain name for E-mail and Web on SBS2003
    ... self-cert from everything while the request was being processed. ... correctly with e-mail and SSL certificate with whatever registered domain ... The company has changed it's name and thus it's registered domain name. ... request and install the new SSL Cert? ...
    (microsoft.public.windows.server.sbs)
  • Re: [PHP] module and access rights
    ... I already started to use SSL, but i do not understand how to keep it ... application control it with information stored into DB and authorize user ... so a session is created and user is redirected to ... insisting that they login for every other request. ...
    (php.general)
  • Re: SSL broken after Windows 2003 upgrade
    ... the 'bad request' bad is a bit weird. ... at the SSL section change 'default' to the IP address. ... > Upgraded this box to Windows 2003, ... > - removed and reinstalled SSL cert ...
    (microsoft.public.inetserver.iis)