I am currently using the following rules in an htaccess file:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
This works well to ensure that myfile.php works as well as just myfile (with no extension). It also handles querystring's with no problems, so myfile?var=foo also works.
The problem is that these are registering in Google Analytics as being too seperate files. So while myfile.php might be the third most popular page on my site, with X visits, myfile might be the fifth most popular page on my site with Y visits.
Is there a way for me to do a hard redirect, rather than "accept either one" type of rule?
Thanks