non-existent HTML suffix

Discussion in 'HTML' started by cous, Mar 12, 2008.

  1. cous

    cous Guest

    Looking in the address bar I'll see pages within a site without the
    HTML suffix, e.g. www.site.com/archive whereas other sites (usually
    less professionally designed ones) will have www.site.com/archive.html.
    How is this achived? Do the pages not have the HTML suffix on the
    server? Confused. Would be grateful for some enlightenment. Thanks.
     
    cous, Mar 12, 2008
    #1
    1. Advertising

  2. cous

    Andy Dingley Guest

    On 12 Mar, 13:53, cous <> wrote:
    > Looking in the address bar I'll see pages within a site without the
    > HTML suffix, e.g. www.site.com/archive whereas other sites (usually
    > less professionally designed ones) will have www.site.com/archive.html


    It's not about a missing "suffix", it's about specifying a directory
    in the URL rather than a page (i.e. the whole filename is missing).
    The web server can be configured (and usually already is) to serve an
    "index page" for each directory, if one exists. These index pages are
    named "index.htm" or "index.html" (on most web servers) or sometimes
    "default.htm" on Windows / IIS.

    Try uploading a page called index.htm to your web hosting, then seeing
    if the server now responds to a URL for that directory.

    If you need to change the config, use Apache as a web server and look
    up details of the .htaccess file.
     
    Andy Dingley, Mar 12, 2008
    #2
    1. Advertising

  3. cous

    cous Guest

    > It's not about a missing "suffix", it's about specifying a directory
    > in the URL rather than a page (i.e. the whole filename is missing).


    I see. So, for example, if I had a gallery page I would put another
    index.html within a gallery folder on the server and it would be
    www.site.com/gallery but then if I had to have more than one gallery
    html file I would need need to have www.site.com/gallery2.html unless
    I created a folder (directory) for each html file. Or am I totally
    mistaken. Sorry, a bit of a newbie with all this.
     
    cous, Mar 12, 2008
    #3
  4. Andy Dingley wrote:
    > On 12 Mar, 13:53, cous wrote:
    >
    >> Looking in the address bar I'll see pages within a site without the
    >> HTML suffix, e.g. www.site.com/archive whereas other sites (usually
    >> less professionally designed ones) will have www.site.com/archive.html

    >
    > It's not about a missing "suffix", it's about specifying a directory in
    > the URL rather than a page (i.e. the whole filename is missing).


    That's not necessarily true. Consider for example:

    http://examples.tobyinkster.co.uk/hcard

    It's certainly not a directory -- it's an actual file on my server called
    "hcard".

    Cous, URLs on the web don't need to have any "suffix". Unlike Windows,
    which relies on the last few letters of the filename to figure out what
    type of file it is (e.g. ".jpeg" is a JPEG image; ".txt" is a text file,
    etc), the Web uses a feature of the HTTP protocol called the Content-Type
    header. As long as that Content-Type header specifies the correct type of
    file (that is "text/html" for an HTML file), it doesn't matter what the
    page's URL is -- it certainly doesn't need to be called "something.html".

    What gets some people confused about the matter is that some web *server*
    software (most, in fact) in the absence of any other information, by
    default, uses the file name's suffix to determine which Content-Type to
    tell the browser. But you don't need to rely on this default behaviour.

    --
    Toby A Inkster BSc (Hons) ARCS
    [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
    [OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 42 days, 22:30.]
    [Now Playing: Jackson 5 - I Want You Back]

    The Semantic Web
    http://tobyinkster.co.uk/blog/2008/03/09/sw/
     
    Toby A Inkster, Mar 12, 2008
    #4
  5. cous

    Andy Dingley Guest

    On 12 Mar, 16:29, Toby A Inkster <>
    wrote:

    > That's not necessarily true.


    Of course not, but it is true in the circumstance the OP is asking
    about. Don't confuse him any more than we have to, just yet!
     
    Andy Dingley, Mar 12, 2008
    #5
  6. Scripsit Toby A Inkster:

    >> It's not about a missing "suffix", it's about specifying a directory
    >> in the URL rather than a page (i.e. the whole filename is missing).

    >
    > That's not necessarily true.


    Technically, it's never true: URLs do not specify directories. A URL has
    a path part, and servers may handle them as they like. Conceptually, a
    server need not even have any file system. In practice, they usually map
    path parts to path names of files, and in _that_ sense, some parts of a
    URL may correspond to directories.

    > Consider for example:
    >
    > http://examples.tobyinkster.co.uk/hcard
    >
    > It's certainly not a directory -- it's an actual file on my server
    > called "hcard".


    Another example:

    http://www.cs.tut.fi/~jkorpela/css-caveats

    You cannot tell what the file name (if any) is, unless I decide to
    reveal it. It happens to be css-caveats.html but it could be just
    anything.

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Mar 12, 2008
    #6
  7. cous

    cous Guest

    > You cannot tell what the file name (if any) is, unless I decide to
    > reveal it. It happens to be css-caveats.html but it could be just
    > anything.


    One issue I have is with Server Includes...I've tried using a Server
    Include without, for example, a HTMLS suffix and it doesn't work,
    although it *does* with it in place. So how do I use Server Includes
    and *not* use a 3 letter suffix on the file...so can I have www.site.com/gallery
    and have a an include within the code of that page. Thanks for all the
    help so far; it's been very educational.
     
    cous, Mar 12, 2008
    #7
  8. cous

    Bergamot Guest

    Andy Dingley wrote:
    > On 12 Mar, 16:29, Toby A Inkster <>
    > wrote:
    >
    >> That's not necessarily true.

    >
    > Of course not, but it is true in the circumstance the OP is asking
    > about.


    I didn't read it that way. The example he posted did not have a slash at
    the end of "index", so I took it as a file without an extension, not a
    directory.

    --
    Berg
     
    Bergamot, Mar 12, 2008
    #8
  9. cous

    dorayme Guest

    In article
    <
    >,

    cous <> wrote:

    > > It's not about a missing "suffix", it's about specifying a directory
    > > in the URL rather than a page (i.e. the whole filename is missing).

    >
    > I see. So, for example, if I had a gallery page I would put another
    > index.html within a gallery folder on the server



    Let's stop here for a moment and say what may or may not be
    obvious to you. You don't *need* to put any such thing. If it is
    important to you that visitors are given... mysite/gallery/
    instead of something like ... mysite/gallery/landscapes.html then
    you need to make an html page and call it as you have been
    advised by others. You would not have landscapes.html but
    index.html for its name. But you can have landscapes.html and
    simply let people know the address to it.

    If you do not have an index file inside a directory and you do
    not give folk a url to a specific html file within that
    directory, at least one of two things will happen if the visitor
    simply goes to a url of a directory, namely ...mysite/gallery/

    (1) A web server page listing the files and folders in that
    directory. For example:

    <http://people.aapt.net.au/~miltonreid/landscapes/>


    or

    (2) A notice from the webserver that you are denied even to look
    at the contents of the folder. For example:

    <http://www.users.bigpond.net.au/tvrs/includes/>

    (in this case, precisely because there is no file called
    specifically index.html etc).

    --
    dorayme
     
    dorayme, Mar 12, 2008
    #9
  10. cous

    Jeff Guest

    Bergamot wrote:
    > Andy Dingley wrote:
    >> On 12 Mar, 16:29, Toby A Inkster <>
    >> wrote:
    >>
    >>> That's not necessarily true.

    >> Of course not, but it is true in the circumstance the OP is asking
    >> about.

    >
    > I didn't read it that way. The example he posted did not have a slash at
    > the end of "index", so I took it as a file without an extension, not a
    > directory.
    >



    If it has the trailing slash it's definitely a directory. If it
    doesn't it may be a file, and that should be checked first, then it
    looks for the various index possibilities.

    A few years ago, leaving off the trailing slash was quite a topic of
    discussion. It's wrong, of course, but practically it makes little
    difference. Put it your html, because it's saves a check, but leave it
    out of your printed stock, because the server will figure it out.

    Jeff
     
    Jeff, Mar 12, 2008
    #10
  11. dorayme wrote:

    >
    > Let's stop here for a moment and say what may or may not be
    > obvious to you. You don't *need* to put any such thing. If it is
    > important to you that visitors are given... mysite/gallery/
    > instead of something like ... mysite/gallery/landscapes.html then
    > you need to make an html page and call it as you have been
    > advised by others. You would not have landscapes.html but
    > index.html for its name. But you can have landscapes.html and
    > simply let people know the address to it.
    >
    > If you do not have an index file inside a directory and you do
    > not give folk a url to a specific html file within that
    > directory, at least one of two things will happen if the visitor
    > simply goes to a url of a directory, namely ...mysite/gallery/
    >
    > (1) A web server page listing the files and folders in that
    > directory. For example:
    >
    > <http://people.aapt.net.au/~miltonreid/landscapes/>
    >
    >
    > or
    >
    > (2) A notice from the webserver that you are denied even to look
    > at the contents of the folder. For example:
    >
    > <http://www.users.bigpond.net.au/tvrs/includes/>
    >
    > (in this case, precisely because there is no file called
    > specifically index.html etc).
    >


    Yes but the point some folks have been correctly making is that URL may
    or may not be analogous to directory structure.

    www.example.com/foo/bar/bam

    'foo' may or may *not* be a directory
    'bar' may or may *not* be a directory
    'bam' may or may *not* be a a file

    not index file involved, they may all be parameters directed to a
    database...



    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Mar 12, 2008
    #11
  12. Jeff wrote:

    > If it has the trailing slash it's definitely a directory. If it doesn't
    > it may be a file, and that should be checked first, then it looks for
    > the various index possibilities.


    Actually that is not true.

    http://www.littleworksstudio.com/Amberlithe/articles/

    Is "articles" a directory on one of my sites? If you say yes you are
    wrong, there is not folder named "articles" and that is not a folder at all.

    URL != Files System

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Mar 12, 2008
    #12
  13. cous

    Jeff Guest

    Jonathan N. Little wrote:
    > Jeff wrote:
    >
    >> If it has the trailing slash it's definitely a directory. If it
    >> doesn't it may be a file, and that should be checked first, then it
    >> looks for the various index possibilities.

    >
    > Actually that is not true.
    >
    > http://www.littleworksstudio.com/Amberlithe/articles/
    >
    > Is "articles" a directory on one of my sites? If you say yes you are
    > wrong, there is not folder named "articles" and that is not a folder at
    > all.
    >
    > URL != Files System


    You can rewrite anything to anything. But in your case it's:

    http://www.littleworksstudio.com/Amberlithe/articles/index.html

    Isn't that one of the various index possibilities? Now whether, you
    mod rewrote that from something else I don't know for sure. Query
    strings commonly get rewritten to look like directories (for SEO), but
    I'm thinking you probably did not do that here. Certainly we weren't
    talking about rewriting URLs.

    Jeff
    >
     
    Jeff, Mar 12, 2008
    #13
  14. cous

    dorayme Guest

    In article <81232$47d83e8c$40cba7b3$>,
    "Jonathan N. Little" <> wrote:

    > dorayme wrote:
    >
    > >
    > > Let's stop here for a moment and say what may or may not be
    > > obvious to you. You don't *need* to put any such thing. If it


    [...]


    > > (1) A web server page listing the files and folders in that
    > > directory. For example:
    > >
    > > <http://people.aapt.net.au/~miltonreid/landscapes/>
    > >
    > >
    > > or
    > >
    > > (2) A notice from the webserver that you are denied even to look
    > > at the contents of the folder. For example:
    > >
    > > <http://www.users.bigpond.net.au/tvrs/includes/>
    > >
    > > (in this case, precisely because there is no file called
    > > specifically index.html etc).
    > >

    >
    > Yes but the point some folks have been correctly making is that URL may
    > or may not be analogous to directory structure.
    >
    > www.example.com/foo/bar/bam
    >
    > 'foo' may or may *not* be a directory
    > 'bar' may or may *not* be a directory
    > 'bam' may or may *not* be a a file
    >
    > not index file involved, they may all be parameters directed to a
    > database...


    I was trying to go back and not blind the OP with science, trying
    to give the ordinary practical things OP might want, to help him.
    Imagining what he probably is dealing with on his server.

    Tell me something Jonathan, did the OP to you seem to be the sort
    of person that would benefit from this display of geek, these
    subtleties?

    (I have sent men to grab bits of your brain for myself. I at
    least will appreciate it. Please don't try to resist. I don't
    want anything damaged when it arrives).

    --
    dorayme
     
    dorayme, Mar 12, 2008
    #14
  15. dorayme wrote:

    > I was trying to go back and not blind the OP with science, trying
    > to give the ordinary practical things OP might want, to help him.
    > Imagining what he probably is dealing with on his server.
    >
    > Tell me something Jonathan, did the OP to you seem to be the sort
    > of person that would benefit from this display of geek, these
    > subtleties?


    Except that it is a fundamental aspect of websites. URL != Files System
    Something you must get a handle on early, else you get stuff like

    <img href="C:\Document and Settings\Bozo\Desktop\Website\My.jpg" ...

    If you want to build a house it helps to know the difference between a
    hammer and a screw driver...

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Mar 12, 2008
    #15
  16. Jeff wrote:

    > You can rewrite anything to anything. But in your case it's:
    >
    > http://www.littleworksstudio.com/Amberlithe/articles/index.html
    >
    > Isn't that one of the various index possibilities?


    No it is *not!* There us no articles folder nor any "index.*" in any
    subdirectory of "Amberlithe"

    > Now whether, you
    > mod rewrote that from something else I don't know for sure. Query
    > strings commonly get rewritten to look like directories (for SEO), but
    > I'm thinking you probably did not do that here. Certainly we weren't
    > talking about rewriting URLs.


    Could be a symbolic link, not necessarily a rewrite, but what does it
    matter, a URL is a URL. But again I say: URL != File System



    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Mar 12, 2008
    #16
  17. cous

    dorayme Guest

    In article <73622$47d863fa$40cba7b3$>,
    "Jonathan N. Little" <> wrote:

    > dorayme wrote:
    >
    > > I was trying to go back and not blind the OP with science, trying
    > > to give the ordinary practical things OP might want, to help him.
    > > Imagining what he probably is dealing with on his server.
    > >


    > If you want to build a house it helps to know the difference between a
    > hammer and a screw driver...


    But not the difference between a not so fine toothed saw and a
    fine toothed one for the sort of houses I build or renovate. I
    don't believe in such fine living. <g>

    Still, I take your larger point.

    --
    dorayme
     
    dorayme, Mar 13, 2008
    #17
  18. cous

    cous Guest

    This is the OP again and I'm clearer on a lot of things. I realize
    that I can easily put www.site.com/gallery.html it was only that on
    more and more sites I seem to visit lately I see the HTML missing. So
    I see www.site.com/gallery (without a finishing /) .
    So this then means there is the index page within this directory...but
    also it's not essential to use a suffix for a page? Because there is
    often more than one page within a directory.

    Also, no one really brought up my issue with Server Includes which I
    include again here...

    I've tried using a Server Include without, for example, a HTMLS suffix
    and it doesn't work,
    although it *does* with it in place. So how do I use Server Includes
    and *not* use a 3 letter suffix on the file?

    Thanks again for all the useful advice.
     
    cous, Mar 13, 2008
    #18
  19. cous

    dorayme Guest

    In article
    <
    >,

    cous <> wrote:

    > This is the OP again and I'm clearer on a lot of things. I realize
    > that I can easily put www.site.com/gallery.html it was only that on
    > more and more sites I seem to visit lately I see the HTML missing. So
    > I see www.site.com/gallery (without a finishing /) .
    > So this then means there is the index page within this directory...


    It means this if the url is to be successful (unlike in one of
    the earlier urls I gave you to demonstrate where there is no such
    file)

    --
    dorayme
     
    dorayme, Mar 13, 2008
    #19
  20. cous wrote:

    > Also, no one really brought up my issue with Server Includes which I
    > include again here...
    >
    > I've tried using a Server Include without, for example, a HTMLS suffix
    > and it doesn't work,
    > although it *does* with it in place. So how do I use Server Includes
    > and *not* use a 3 letter suffix on the file?


    Depends on how the server is setup, if allow in .htaccess you can change
    it with AddHandler or ever set it for a certain folder like cgi-bin is
    normally for CGI...

    Just most servers use the .shtml extension to clue the server that
    server side include processing is required.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Mar 13, 2008
    #20
    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. Paul W

    Non-existent datagrid?

    Paul W, Nov 10, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    332
    Paul W
    Nov 10, 2004
  2. ElGordo
    Replies:
    2
    Views:
    6,137
    Ersin Gençtürk
    Apr 29, 2005
  3. Joel D. Kraft

    Non-existent page is not throwing 404 error

    Joel D. Kraft, May 24, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,483
    Joel D. Kraft
    May 25, 2005
  4. dkode
    Replies:
    4
    Views:
    770
    dkode
    Apr 12, 2006
  5. Les Caudle
    Replies:
    1
    Views:
    346
    Cowboy \(Gregory A. Beamer\)
    Sep 19, 2006
Loading...

Share This Page