Sunday 27 May 2012

DirectoryIndex and AddType - Apache

The DirectoryIndex directive sets the list of resources to look for, when the client requests an index of the directory by specifying a / at the end of the a directory name.

DirectoryIndex index.html index.php /cgi-bin/index.pl
would cause the CGI script /cgi-bin/index.pl to be executed if neither index.html or index.php existed in a directory.
You can write PHP code in a file with extension other than .php but still the server recognises and execute it. This is possible if you add the below line in apache conf file  

AddType application/x-httpd-php .bop .foo .133t
AddType application/x-httpd-php .asp .py .pl
AddType application/x-httpd-php .htm .html

Reference: http://php.net/manual/en/security.hiding.php