I have an URL Rewrite rule in .thaccess that does exactly what I want it to:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)$ /page.php?id=$1 [L]
So requests to www.site.com/page.php?id=one
are redirected to this: www.site.com/one
, which is what is needed.
However, there is a problem - if any of the other filenames in the main dir is misspelled then the browser redirects to www.site.com/page.php?id=
So for example if the name of www.site.com/other.php
is misspelled with anything like www.site.com/otherr.php
, then the .htaccess rule kicks in and the URL the user sees is www.site.com/otherr.php
, while the content showing is the one of page.php
.
Any ideas what in the rewrite rule needs to be changed to remediate this problem?