SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Root directory

  1. #1
    SitePoint Member
    Join Date
    Aug 2003
    Location
    Auburn, Washington
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Root directory

    I am having trouble with previewing the website I am working on. Lots of my references to other files need to contain the root directory symbol("/", i.e. <img src="/folder/filename.jpg">). However. when I put those in I can't preview the files properly because it goes several folders up to the hard drive. Is there some way to set the folder I am working in as a root directory of some sort?

    -Thanks

  2. #2
    SitePoint Wizard geiger's Avatar
    Join Date
    Jul 2001
    Posts
    2,459
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When working on your computer, it's usually hard to set a "root" directory unless you're using Dreamweaver or a similar program. Instead, use relative addresses, example: folder/filename.jpg or if needed, ../folder/filename.jpg or ../../folder/filename.jpg , etc. That'll always come up with the relative placement of the file.

  3. #3
    SitePoint Addict BenANFA's Avatar
    Join Date
    Apr 2003
    Location
    Bath, UK
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you are using a Windows box then

    Windows: 2k/XP/98/95

    Use the subst command, you can run it from the command line or put a batch file to run it in your Startup menu.

    Format:

    subst <DriveLetter>: c:\<LocalPath>

    example

    subst w: c:\website

    This will make w: appear as a drive to all programs containing the contents of c:\website with c:\website as the root.

    Then do your development on the new drive.

    To remove the subst

    subst w: -d

    For WinNT it is slightly harder because they didn't ship it with the subst command. However you can get round it if you happen to be on a network. From Explorer share the directory (c:\website) then also from explorer connect to your own share. This again will set up a drive letter that will be the root of your source.


    I'm afraid I can't help with UNIX/Linux cos I no nothing about the

  4. #4
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As an alternative, setup an HTTP Server, like Apache, and connect to http://localhost/
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  5. #5
    SitePoint Wizard davidjmedlock's Avatar
    Join Date
    Dec 2002
    Location
    Nashville, TN USA
    Posts
    1,688
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Jeff's idea is best. If on Windows 2k, you can easily install IIS, although this will require that you learn a bit about administering it and securing it, otherwise you may get hacked to bits if you're on a cable modem/DSL. But it will go a long way towards solving your root directory problems.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •