I want to use .htaccess for rewriting of php web pages. Or in a simple way "I don't want to use .php extension" to access any web page.
.htaccess file (Ubuntu 14) which was working perfectly:
RewriteEngine on
#remove the need for .php extention
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
Same .htaccess file is not working after upgrade of AWS which is now in Ubuntu 16.04. I tried everything like changing the permission, enabling the rewrite mode, changing the config file Directory property from 'AllowOverride None' to 'AllowOverride All'.
After some sort of experiment I found to be amend the above .htaccess file as below and it worked fine. But here it always allow to access only given php page. But I don't want to be specific with any given php page. I tried writing regexp as well but didn't work. And it always redirect to the given page only.
<IfModule mod_rewrite.c><
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
</IfModule>
Can someone help me on this. Thanks in advance.