Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Houston, Tx, USA
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts

    syntax of relative reference to a file in root

    I want to create hyperlynks in page1a.htm and page1b.htm to a page2.htm that will always be in the root of the disk or storage device that has my web pages. Example:

    Eage2.htm
    E:htmlpage1a.htm
    E:htmlexamplespage1b.htm

    I plan to copy everything "as is" (no editing of any kind) to a portable device or CD, flash drive. Therefore, E: will probably be re-assigned any letter name available in the local PC or network drive.

    What would be the correct syntax of the relative reference to a file in the root directory? Can you give me some examples?

    Thank you
    Guillermo

  2. #2
    Plutonium Lounger
    Join Date
    Oct 2001
    Location
    Lexington, Kentucky, USA
    Posts
    12,107
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: syntax of relative reference to a file in root

    Given YOUR examples, it seems to me that the correct relative syntax is to simply omit the E: portion of your examples, assuming the subdirectories html and examples do exist. If the pages get placed on a web page in that same manner, I think all one would have to add would be the domain name before the first backslash. Someone jump in if I'm not saying it correctly. I have a dedicated partition called WEB on one of my drives and the file and directory structure mirrors the way my web domain is setup (ALHOFFMAN.ORG) so files on my disk are setup in the fashion you describe and only require "references" to start with the first backslash.

  3. #3
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Houston, Tx, USA
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: syntax of relative reference to a file in root

    The web pages are not inteded to be posted in a web site or a web server.

    I plan to use web pages to transport and display different sorts of information in flash drives or CD's, given that any computer today has a web browser.

    Could you type in some examples? I' am a begginer with html, and learning the hard way..!

    Thank you
    Guillermo

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: syntax of relative reference to a file in root

    If you always know the depth of the folder in question, this is easy. In HTML, you can omit any folder name to reference a file within the same folder.

    For any folder above the location of the current page, simply use dot-dot-slash (../) to represent one folder up. You can use multiple dot-dot-slahes for multiple folders above.

    For example, to navigate from C:inetpubwwwrootPage1.htm to:

    C:inetpubPage2.htm = Page 2
    C:Page3.htm = Page 3

    To acces a folder below the current page, simply include the folder name in the link.

    For example, to navigate from C:Page1.htm to:

    C:inetpubPage2.htm = Page 2
    C:inetpubwwwrootPag3.htm = Page 3

    Moving the contents of this path structure to another drive or folder should not change the links - as long as they are still relative to each other (this is the key).

    Hope this helps.

  5. #5
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Houston, Tx, USA
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: syntax of relative reference to a file in root

    your examples are excellent ! <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>

    but I need the only one that you did not address:

    go from E:my_webcarspage1.htm

    to E:my_webboatspage2.htm

    can this be done? <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

    THANK YOU
    Guillermo

  6. #6
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: syntax of relative reference to a file in root

    No problem! <img src=/S/bow.gif border=0 alt=bow width=15 height=15>

    Yes, this can be done. Think of the dot-dot-slash as a way of "traversing folder levels" - in other words, setting a different folder level as the new starting point. So, in your example (E:my_webcarspage1.htm to E:my_webboatspage2.htm) you could use a dot-dot-slash to change your starting point from the cars folder to my_web. Then simply add boats/page2.htm to move down to the boats folder. (Note the use of backslash in the windows environment but the use of forward slash in the web environment.)

    The example would be this:

    From E:my_webcarspage1.htm to point to E:my_webboatspage2.htm
    would be this:
    Page 2

    Hope this helps.

  7. #7
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Houston, Tx, USA
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: syntax of relative reference to a file in root

    Great help! <img src=/S/bananas.gif border=0 alt=bananas width=33 height=35>

    Thank you.
    Guillermo

Posting Permissions

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