I would like to delete extensions like .php, .html, etc from my url and this is what I use:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteRule ^([^\.]+)$ $1.html [NC,L]
It works but I don't know if this is the best way to do this and I also don't understand how it works, could someone explain it?
The second thing I would like to realise is to make the URL more beautiful by doing something like this:
this is my URL: http://domain.com/portfolio/project.php?id=1 this is what I would like to see: http://domain.com/portfolio/project/1
Thanks in advance