I am using the code below in my htaccess file that always sends the site to the www version and allows the file extension to be removed if php. However, if a visitor types the extension, it still shows it.
How do I remove the file extension even if the visitor types it?
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php