locked
Pointing to Home page issue RRS feed

  • Question

  • Hi,

    I just changed all links from index.htm to ../ for links.    When I look in pages that are not on the root (www.domain.com/pages/page1.htm)  I am seeing ../../     Is this correct?   I have just never seen it done like this.

    Thanks in advance.

    Peter

    Thursday, May 27, 2010 11:42 PM

Answers

  • Hi,

    I just changed all links from index.htm to ../ for links.    When I look in pages that are not on the root (www.domain.com/pages/page1.htm)  I am seeing ../../     Is this correct?   I have just never seen it done like this.

    Thanks in advance.

    Peter


    Depends on how many levels away from the root of the web are the folders that have the pages with the links.

    ../ one folder from ( below ) the root

    ../../ two folders from ( below ) the root.

    The server doesn't need the actual name of the folder(s) it just needs to know how much "closer to the root" it needs to look.

     

     


    Expression Web MVP
    • Marked as answer by Petersocal Friday, May 28, 2010 4:46 AM
    Friday, May 28, 2010 2:23 AM

All replies

  • Hi,

    I just changed all links from index.htm to ../ for links.    When I look in pages that are not on the root (www.domain.com/pages/page1.htm)  I am seeing ../../     Is this correct?   I have just never seen it done like this.

    Thanks in advance.

    Peter


    Depends on how many levels away from the root of the web are the folders that have the pages with the links.

    ../ one folder from ( below ) the root

    ../../ two folders from ( below ) the root.

    The server doesn't need the actual name of the folder(s) it just needs to know how much "closer to the root" it needs to look.

     

     


    Expression Web MVP
    • Marked as answer by Petersocal Friday, May 28, 2010 4:46 AM
    Friday, May 28, 2010 2:23 AM
  • The ".." notation is standard for indicating the parent directory. So, from your file two levels deep in the folder structure, "../../" indicates a location two directories above, or the site root, in this case.

    cheers,
    scott


    C'mon, folks. This isn't rocket science, nor neurosurgery. It's "Expression" (singular) "Web" (singular), in that order, followed by a version numeral if you wish to be specific. It is often abbreviated "EW." It is not "Web Expression," "Expressions Web," "Web Expressions," or plain "Expression" or "Expressions." Not using the correct name indicates either ignorance or laziness. Most folks would rather avoid the appearance of either.
    Friday, May 28, 2010 2:24 AM
  • Steve and Scott,

    Thanks.   I never knew that each level away from the root needed another ../       

    I always assumed that ../ would take you to the root from any level.   Now I know better... :)

     

    Peter

    Friday, May 28, 2010 4:48 AM
  • ../ means the folder you are in
    .../ means one folder up from where you are
    .../../ means two folders up

    If a file is in the root folder, then the relative link from that file to the home page would be
    ../ but definitely not ../ which is outside the website.



    Ron Symonds
    Microsoft MVP (Expression Web)

    www.rxs-enterprises.org/fp
    Friday, May 28, 2010 7:25 AM
  • Umm, Ron, I think you meant "If a file is in a folder located in the root folder..."

    If a file is in the same (root) folder with the home page, no folder prefix is required at all, parent or otherwise.  ;-)

    [EDIT: Well, after posting I went up and looked again, and it appears the first line is incorrect, too. "../" means "go up one level and look for the filename following the forward slash." So, "../marker.html" points to a file named marker.html in the parent directory to the one where the reference is located. The seldom-used single-dot notation, "./" refers to the current directory, and is usually unnecessary, and to be honest, I have never heard of or seen used a three dot ".../" notation.]

    cheers,
    scott


    C'mon, folks. This isn't rocket science, nor neurosurgery. It's "Expression" (singular ) "Web" (singular ), in that order, followed by a version numeral if you wish to be specific. It is often abbreviated "EW." It is not "Web Expression," "Expressions Web," "Web Expressions," or plain "Expression" or "Expressions." Not using the correct name indicates either ignorance or laziness. Most folks would rather avoid the appearance of either.
    Friday, May 28, 2010 6:31 PM
  • If a file is in the root folder, then the relative link from that file to the home page would be
    ../ but definitely not ../ which is outside the website" is exactly what I meant.
    ../ from a folder in the root folder would give a page in that folder.

    Consider:
    <a href="../../">Home page from 2 folders down</a>
    <a href="../">Home page from one folder down</a>
    <a href="./">Home page from root folder</a>

    <a href="./mypage.htm">Link to mypage from a page in same folder as mypage.htm</a> (hardly ever used)
    <a href="mypage.htm">Another link to mypage from a page in the same folder as mypage</a>



    Ron Symonds
    Microsoft MVP (Expression Web)

    www.rxs-enterprises.org/fp
    Friday, May 28, 2010 6:54 PM