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:
- Is the above statement correct?
- 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?
- 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?
- According to some sources to add PHP support to Apache we have to use
AddType application/x-httpd-php .phpwhile others say to use
AddHandler application/x-httpd-php .phpwhich in my opinion is the only correct becouse
addTypeshould be used only for static documents. So why the
addTypeversion 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?