relative paths

Discussion in 'ASP General' started by jt, Feb 12, 2004.

  1. jt

    jt Guest

    our web application is currently using relative paths in
    various places throughout our code. im working on
    eliminating this, but not sure of the best way to go about
    it. i want to avoid hardcoding the path to make migration
    easier and more manageable. i thought there is a way to
    user the request object?? request.servervariables or
    something - any help would be greatly appreciated..

    thanks

    jt
    jt, Feb 12, 2004
    #1
    1. Advertising

  2. jt

    Roland Hall Guest

    "jt" wrote:
    : our web application is currently using relative paths in
    : various places throughout our code. im working on
    : eliminating this, but not sure of the best way to go about
    : it. i want to avoid hardcoding the path to make migration
    : easier and more manageable. i thought there is a way to
    : user the request object?? request.servervariables or
    : something - any help would be greatly appreciated..

    Why not just start at the root for all links?

    /default.asp
    /asp/somefile.asp
    /js/somefile.js
    /images/somefile.jpg

    You move this site to another server, a different domain and it all still
    works as it does on this site. There is no change unless you modify your
    structure.

    You can also create a header file that assigns file paths as variables and
    create them as constants. Link that in with every page, along with other
    header processing routines, so if you decided to change /images to
    /pictures, you make one change in the header.

    HTH...

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
    Roland Hall, Feb 12, 2004
    #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. Kathy Burke
    Replies:
    0
    Views:
    514
    Kathy Burke
    Nov 14, 2003
  2. Curt_C [MVP]

    Re: Relative Paths

    Curt_C [MVP], May 25, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    347
    =?Utf-8?B?QW5kcmV3IFdpZWQ=?=
    May 26, 2004
  3. terrorix

    Re: Relative Paths

    terrorix, May 26, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    365
    terrorix
    May 26, 2004
  4. Noah
    Replies:
    5
    Views:
    767
  5. Ohad Lutzky

    Paths, gentleman, paths

    Ohad Lutzky, Nov 6, 2006, in forum: Ruby
    Replies:
    2
    Views:
    184
    David Vallner
    Nov 7, 2006
Loading...

Share This Page