Handling files by http server

As i understand when the server (e.g. Apache) receives a request it looks for file name extension to find associated mime-type. Then it looks for the handler handling this mine-type (i’m stating it based off adding PHP support to Apache). And here are my questions:

  1. Is the above statement correct?

  2. If so when there is no handler for given mime-type does it mean the default behavior - that is just send a file to the client?

  3. If there is even no explicit extension - mime-type association defined (e.g. .html) the default action again is just send a file to the client?

  4. According to some sources to add PHP support to Apache we have to use addType directive: AddType application/x-httpd-php .php while others say to use addHandler directive: AddHandler application/x-httpd-php .php which in my opinion is the only correct because addType should be used only for static documents. So why the addType version is still correct?

    I found somewhere such a lines:

AddType text/html .php .phps AddHandler application/x-httpd-php .php AddHandler application/x-httpd-php-source .phps

Does it mean that AddType directive will be used if the server can’t find the handler for application/x-httpd-php mime-type and the action would be just to send .php source file to the client with text/html mime-type in response?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.