Re: ./ a small thing but it seems to do a lot

Discussion in 'HTML' started by Richard, Jul 22, 2003.

  1. Richard

    Richard Guest

    "David Graham" <> wrote in message
    news:ymaTa.1281$...
    > Hi
    > I often come across ./ in links such as below
    >
    > <div class="buttons">
    > <a href="./index.php?screen=test">test</a>
    > <a href="./index.php?screen=longerTest">longerTest</a>
    > </div>
    >
    > Mousing over the top link reveals the full URL in the status bar, like

    this
    >
    > http://porjes.haxorz.org/index.php?screen=test
    >
    > So the ./ notation takes you to the next page on the site via a full URL.
    > My site is hosted by phphosting.com. They store all sites like mine in a
    > folder called, naturally enough:


    "./" means from this folder. it really isn't it needed but in some cases it
    helps to clarify things.
    "../" means back up one folder. you may have images stored in another
    directory not on this path.
    but if you move back up one folder, there it is.



    >
    > www
    >
    > if I use a link on a page in my site to the home page like this
    >
    >
    > <a href="./>home</a>
    >
    > then I see in the status bar
    >
    > http://www.catalysys.co.uk/
    >
    > There is no www folder in the URL - why not?


    This is your "root" directory assigned by the host.
    they can call it anything they want afaik, but it won't matter because
    that's where the DNS zoning comes into play.



    >
    > When I try the links that have ./ in them on my local computer, rather

    than
    > getting the home page as expected, I get the folder that contains the site
    > on my PC opening up showing the folder and file icons the make up my site.
    > If I use a forward slash with no period infront of it, would that go to

    the
    > root folder and then find and open the index page on my PC or on the
    > internet ? (all pages on my site, both locally and on the remote host are
    > stored in the same folder - as I pointed out earlier, this is called www

    on
    > the remote host)


    The leading "/" is not needed unless you want to use it for clarification.
    but you probably should use "/images/name.jpg" if you want to grab an image
    from that directory.

    The forward slash is merely a directory seperator.
    as in c://windows/system.

    Use of the dot notation should be avoided in web pages. Just write the
    entire path name.




    >
    > thanks
    > David
    >
    >
    >
    >
    >
     
    Richard, Jul 22, 2003
    #1
    1. Advertising

  2. Richard

    Geoff Ball Guest

    Richard <> wrote in alt.html:

    > "David Graham" <> wrote in message
    > news:ymaTa.1281$...


    >> I often come across ./ in links


    > "./" means from this folder. it really isn't it needed but in some cases
    > it helps to clarify things.


    In many cases, it is needed. In Linux, typing `configure` at the prompt will
    search the user's PATH for a file called configure. Only when typing
    `./configure` will the current directory be searched (assuming the current
    directory isn't in the path, in which case just `configure` *would* work.


    >>
    >> When I try the links that have ./ in them on my local computer, rather

    > than
    >> getting the home page as expected, I get the folder that contains the
    >> site on my PC opening up showing the folder and file icons the make up my
    >> site. If I use a forward slash with no period infront of it, would that
    >> go to

    > the
    >> root folder and then find and open the index page on my PC or on the
    >> internet ? (all pages on my site, both locally and on the remote host are
    >> stored in the same folder - as I pointed out earlier, this is called www

    > on
    >> the remote host)

    >
    > The leading "/" is not needed unless you want to use it for clarification.


    No, the leading slash makes the path absolute; without it, the path would be
    relative. The difference is quite important, as both act very differently.

    > Use of the dot notation should be avoided in web pages. Just write the
    > entire path name.


    This statement should be ignored. Dot notation *should* be used, as:

    1) It allows you to easily switch domain names.

    2) It doesn't require a DNS lookup for every single link.

    Regards,
    Geoff

    --
    http://www.doctype.ca/
    http://www.allmyfaqs.com/faq.pl?Geoff_Ball
     
    Geoff Ball, Jul 22, 2003
    #2
    1. Advertising

  3. Richard

    Art Sackett Guest

    Richard <anom@anom> wrote:

    > This is your "root" directory assigned by the host.
    > they can call it anything they want afaik, but it won't matter because
    > that's where the DNS zoning comes into play.


    I wasn't aware that DNS had anything to do with it. Care to elaborate?

    --
    Art Sackett,
    Patron Saint of Drunken Fornication
     
    Art Sackett, Jul 22, 2003
    #3
  4. Richard

    Geoff Ball Guest

    Jacqui or (maybe) Pete <> wrote in
    alt.html:

    > In article <>, says...
    >> Richard <> wrote in alt.html:


    >> > "David Graham" <> wrote in message
    >> > news:ymaTa.1281$...


    >> >> I often come across ./ in links


    >> > "./" means from this folder. it really isn't it needed but in some
    >> > cases it helps to clarify things.


    >> In many cases, it is needed. In Linux, typing `configure` at the prompt
    >> will search the user's PATH for a file called configure. Only when typing


    > Sure - but not in any html cases surely?


    In HTML, no, it's not *needed* anywhere. It will simply act the same as if
    nothing precedes the file name.

    Regards,
    Geoff

    --
    http://www.doctype.ca/
    http://www.allmyfaqs.com/faq.pl?Geoff_Ball
     
    Geoff Ball, Jul 22, 2003
    #4
  5. Richard

    Art Sackett Guest

    Bill Logan <> wrote:

    >> In Apache it's in httpd.conf, anyway. ;-)
    >>

    > Yeah, sometimes I forget there are other servers :-()


    :) Me, too! :)

    My take on Apache is simple: Apache's already free, already best, so
    why mess around with anything else?

    --
    Art Sackett,
    Patron Saint of Drunken Fornication
     
    Art Sackett, Jul 24, 2003
    #5
    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. Jeremy Williams
    Replies:
    1
    Views:
    351
    Hywel Jenkins
    Jul 22, 2003
  2. Replies:
    12
    Views:
    533
    Andre Kostur
    Sep 28, 2005
  3. Stimp

    small thing on VS2005

    Stimp, Aug 10, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    316
    Alexey Smirnov
    Aug 10, 2007
  4. Replies:
    0
    Views:
    307
  5. Zam
    Replies:
    1
    Views:
    266
    Mark Schupp
    Mar 14, 2005
Loading...

Share This Page