I recently switched from using this in my .htaccess file
RewriteRule ^example index.php?page=example [L]
To this:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^./]+)/?$ index.php?page=$1 [L,QSA]
The issue is that if I visit something like example.com/euffhfrfreif - it'll just display me my homepage.
I'm trying to configure vanity URLs, so that rather than visitors using example.com/index.php?page=contact, they'll just visit example.com/contact - I've seen this a lot online and it's supposed to be better for Google, etc.
This error doesn't apply to any folders, so visiting example.com/djfhds/fdjdnf will display a 404 error.
How can I get my 404 error back but keep (or keep something similar too) my new system?
Also: I have rewriteengine on and a 404 error page defined in .htaccess.