I have a custom folder with number of php files. i want to create a friendly URL by removing .php from the URL.So i have created the .htaccess file in the custom folder where all the .php files located and written the below code but its is not working.
My URL is: magento/cl/unilever.php
Expected URL: magento/cl/unilever
.htaccess contains:
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^unilever $ unilver.php
Assuming you want to rewrite just single directory, try this one:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(\w*)$ $1.php [L]