I am trying to achieve url rewrite to remove php extension from the php files, but I cannot figure out what's wrong! I am using lampp on ubuntu machine and I even set the AllowOverride from none to All in httpd.conf:
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All <--- I set it from "None" to "All"
and I have placed my .htacces file in the root of my project folder ie. projects/test/ (I don't even know this is right place the .htaccess file).My localhost url is like: http://localhost/projects/test/abc.php
. I want it to be set as http://localhost/projects/test/abc
.Here's my url rewrite code:
Options +FollowSymLinks -MultiViews
<IfModule mod_rewrite.so>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
</IfModule>
I even tried with <IfModule mod_rewrite.c>