get host URL

Discussion in 'ASP General' started by Fetty, Apr 4, 2005.

  1. Fetty

    Fetty Guest

    I need to grab the full url of the virtual server server of the image
    directory
     
    Fetty, Apr 4, 2005
    #1
    1. Advertisements

  2. no doubt there are better way to do this , but I have done this in the past

    BASE_URL = "http://" & Request.ServerVariables("HTTP_HOST") &
    Replace(Request.ServerVariables("URL"),"somefolder/thispage.asp","")

    PictureURL = BASE_URL & "pictures"

    In the 1st part you replace what you don't want from the current full url to
    the page your on
    .......based on what ".asp" page/folder you are running at the time.

    Then to build your picture folder url you add what folder info you need.

    It's going to be slightly different depending on your site layout, where you
    are, and the names of your pages and scripts, but this works.

    I am sure there is a way better way to do it

    --
    Christopher Williams

    www.PowerASP.com
    www.CJWSoft.com


    "Fetty" <> wrote in message
    news:...
    >I need to grab the full url of the virtual server server of the image
    >directory
    >
     
    Christopher Williams, Apr 4, 2005
    #2
    1. Advertisements

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. sandeep pandit via .NET 247
    Replies:
    0
    Views:
    1,013
    sandeep pandit via .NET 247
    Apr 28, 2004
  2. Jon paugh
    Replies:
    1
    Views:
    1,372
  3. Nilson
    Replies:
    3
    Views:
    55,070
    Nilson
    Jul 24, 2003
  4. Orpheus66
    Replies:
    0
    Views:
    5,057
    Orpheus66
    Jul 30, 2003
  5. =?Utf-8?B?U3RlcGhhbmU=?=

    Get the exact URL host name

    =?Utf-8?B?U3RlcGhhbmU=?=, Sep 19, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    605
    Juan T. Llibre
    Sep 19, 2006
  6. Jerry Qu
    Replies:
    1
    Views:
    693
    lee atkinson
    Feb 20, 2009
  7. Just D.
    Replies:
    0
    Views:
    836
    Just D.
    Aug 11, 2004
  8. David Thielen

    Get full url from relative url

    David Thielen, May 25, 2006, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    375
    David Thielen
    May 26, 2006
Loading...