Run php files without typing in the extension in apache

On i-mscp, edit the file /etc/apache2/sites-available/domain.com.conf,

Modify:

<Directory /var/www/virtual/joel.co.in/htdocs>
        Options -Indexes +Includes +FollowSymLinks +MultiViews
        # SECTION php_enabled BEGIN.
        AllowOverride All
        # SECTION php_enabled END.
        Order allow,deny
    Allow from all
    </Directory>

adding the following:

Options +MultiViews
DirectoryIndex index.php
AddType application/x-httpd-php .php

so that final code becomes:

 <Directory /var/www/virtual/joel.co.in/htdocs>
        Options -Indexes +Includes +FollowSymLinks +MultiViews
        DirectoryIndex index.php
        AddType application/x-httpd-php .php
        # SECTION php_enabled BEGIN.
        AllowOverride All
        # SECTION php_enabled END.
        Order allow,deny
    Allow from all
    </Directory>

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.