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. Advertising

  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. 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. Jon paugh
    Replies:
    1
    Views:
    678
  2. Orpheus66
    Replies:
    0
    Views:
    4,392
    Orpheus66
    Jul 30, 2003
  3. =?Utf-8?B?U3RlcGhhbmU=?=

    Get the exact URL host name

    =?Utf-8?B?U3RlcGhhbmU=?=, Sep 19, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    458
    Juan T. Llibre
    Sep 19, 2006
  4. Jerry Qu
    Replies:
    1
    Views:
    440
    lee atkinson
    Feb 20, 2009
  5. Just D.
    Replies:
    0
    Views:
    397
    Just D.
    Aug 11, 2004
Loading...

Share This Page