From non-ssl area to ssl ara with a virtual href path?

Discussion in 'ASP .Net' started by 620, Jan 6, 2004.

  1. 620

    620 Guest

    I have a simple link/href in the 'default' http/80 area that points the user
    to the 'secure' https/443 area, which is just a sub-folder that requires
    SSL. Before SSL was implemented, I used a virtual href
    ("/securearea/main.aspx") but once I implemenet SSL, I get that "You must
    prefix the url with https://..." error page.

    And I generally understand why I'm getting that error (because ssl doesn't
    use http/80, it uses https/443, and I'm guessing a virtual path ultimately
    inherits the current http/s/port settings). But now I'm wondering is there
    a way to use a virtual href for this at all, or do I absolutely need to
    provide the full url when pointing into SSL-territory, i.e. https://etc ? I
    only ask because my dev machine and the live machine have different URLs and
    run on different ports (but beyond that, have the same file structure), and
    so far I've been using virtual pathing and avoided the need for those
    annoying global dev/live variables that must be switched every time you
    compile live content.
     
    620, Jan 6, 2004
    #1
    1. Advertising

  2. 620 wrote:

    > I have a simple link/href in the 'default' http/80 area that points the user
    > to the 'secure' https/443 area, which is just a sub-folder that requires
    > SSL. Before SSL was implemented, I used a virtual href
    > ("/securearea/main.aspx") but once I implemenet SSL, I get that "You must
    > prefix the url with https://..." error page.
    >
    > And I generally understand why I'm getting that error (because ssl doesn't
    > use http/80, it uses https/443, and I'm guessing a virtual path ultimately
    > inherits the current http/s/port settings). But now I'm wondering is there
    > a way to use a virtual href for this at all, or do I absolutely need to
    > provide the full url when pointing into SSL-territory, i.e. https://etc ? I
    > only ask because my dev machine and the live machine have different URLs and
    > run on different ports (but beyond that, have the same file structure), and
    > so far I've been using virtual pathing and avoided the need for those
    > annoying global dev/live variables that must be switched every time you
    > compile live content.
    >
    >


    Yes, the only way to do this is to provide a complete URL, as a relative
    one uses the same http:// prefix. Remember if you send https:// to the
    browser, it will assume 443, as that is the normal port that is used.
    Otherwise send http://myserver:445/ if you run SSL over port 445 (or for
    an address that doesn't run over port 80).

    But you'll have to rebuild the URL yourself using the Request properties
    and/or Control.ResolveUrl. You shouldn't have to hardcode anything; if
    you need varying values, put values in the web.config (for port numbers,
    etc.).

    --
    Craig Deelsnyder
    Microsoft MVP - ASP.NET
     
    Craig Deelsnyder, Jan 6, 2004
    #2
    1. Advertising

  3. Murat Tunaboylu, Jan 6, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. CRON
    Replies:
    24
    Views:
    201,686
    Adrienne Boswell
    Jun 20, 2006
  2. =?Utf-8?B?SmVmZiBCZWVt?=

    physical path to virtual path under virtual directory

    =?Utf-8?B?SmVmZiBCZWVt?=, Aug 1, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    1,067
    Eliyahu Goldin
    Aug 1, 2007
  3. James Edward Gray II
    Replies:
    2
    Views:
    144
    Gregory Brown
    Nov 8, 2006
  4. Peña, Botp
    Replies:
    1
    Views:
    103
    Peña, Botp
    Mar 3, 2008
  5. Soren Vejrum
    Replies:
    4
    Views:
    667
    Lasse Reichstein Nielsen
    Jul 5, 2003
Loading...

Share This Page