apache2 “Negotiation: discovered file(s) matching request: None could be negotiated”

neulich… beim umzug einer fotogalerie auf einem anderen webserver kam neben der entsprechenden fehlermeldung im browser (file not found) diese fehlermeldung im error.log:

AH00687: Negotiation: discovered file(s) matching request: /var/www/htdocs/domain.tld/index (None could be negotiated)., referer: http://domain.tld/

nach etwas googlen war mir klar, dass das mit der option “MultiViews” zusammenhaengt.

die apache webseite weiss dazu:

The effect of MultiViews is as follows: if the server receives a request for /some/dir/foo, if /some/dir has MultiViews enabled, and /some/dir/foo does not exist, then the server reads the directory looking for files named foo.*, and effectively fakes up a type map which names all those files, assigning them the same media types and content-encodings it would have if the client had asked for one of them by name. It then chooses the best match to the client’s requirements.

heisst also… beim aufruf von “http://domain.tld/index” schaut der webserver, ob er eine datei “index” mit einer irgendeiner dateiendung findet. er haette eigentlich in diesem falle die vorhanden index.php finden und nehmen sollen…. hat er aber nicht. grund dafuer war, dass der webserver nicht wusste, was er mit der dateianedung “php” anfangen soll.

bei einem debian stretch wird der umgang mit den mimetypes mit dem apache modul “mime” geregelt. am anfang der datei /etc/apache2/mods-available/mime.conf steht geschrieben:



   TypesConfig points to the file containing the list of mappings from
   filename extension to MIME-type.
   #
   TypesConfig /etc/mime.types

also husch in der /etc/mime.types geschaut und gesehen, dass diese zeile auskommentiert ist:

# application/x-httpd-php      phtml pht php

kommentarzeichen davor weg, speichern, apache neu starten und gut.

Author: sd

Leave a Reply

Your email address will not be published. Required fields are marked *