Apache accepts only html not htm

Discussion in 'Installation/Configuration' started by provell, May 17, 2006.

  1. provell

    provell New Member

    Hy everyone,

    My apache server is only accepting a index.html not index.htm files?

    I did follow the "The perfect debian 3.1 setup" and changed the DirectoryIndex in the apache2.conf file as I schould.

    The is the problem on 2 machines so it could not be a one time typo:D

    Any help on the matter is verry much appreciated.:)

    Rgds Edo
  2. provell

    provell New Member


    Okee, sorry RTFM question.
    Apache does not accept htm pages by default.

    Still don't understand than why I have to edit the DirectoryIndex to:
    DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml ??

    Will do some more reading on the matter.
  3. falko

    falko Super Moderator Howtoforge Staff

    If your index page always is index.htm, then

    DirectoryIndex index.htm
    would be sufficient. But it's safer to have

    DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml
    because sometimes your index page is named index.php, sometimes index.html, etc.
  4. provell

    provell New Member

    more on the matter

    Thanks for you're response and sorry to carry on the discussion but i'm realy trying to understand this stuf.

    After doing some reading on apache freaks I found the folowing.

    DirectoryIndex index.html

    then a request for http://myserver/docs/ would return http://myserver/docs/index.html if it exists, or would list the directory if it did not.

    Note that the documents do not need to be relative to the directory;

    DirectoryIndex index.html index.txt /cgi-bin/index.pl

    would cause the CGI script /cgi-bin/index.pl to be executed if neither index.html or index.txt existed in a directory

    This would suggest that the line,
    DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml

    should accept a file like index.htm!!

    Why is my configuration than not accepting the index.htm?

    Is there an other file to edit or a module not loaded correct.
    Are there variables in memory that can be checked by some command.

    Thanks in advance

    Rgds Edo
  5. falko

    falko Super Moderator Howtoforge Staff

    Apache reads the files in the order you put them in the configuration. Therefore, if you have a file index.html and a file index.htm in your directory, then Apache will deliver index.html because it comes first.
  6. provell

    provell New Member

    got it

    I know that there can only be one index.* file in that location.
    Sorry for the misunderstanding.

    At least I have fixed the problem.

    While I was helping the site owner, he mentiond the problem of the htm and html file. He had 2 files and after renaming one of them to old_index.* the html file was not read du to an update he made in his file.
    He had a <IFrame> tag wich is not accepted by apache.
    I thought the files were identical and after all, on his windows desktop all worked fine in his local (windows)apache installation. I was getting some kind of acces denied message so I thougt apache could not read the file. But it could not read the <IFrame> part.

    Well at least I learned a lot of apache and wish to thank you for all you're help.

    Thanks!!!:D :D

Share This Page