OS: Mac Monterey
Web Server: Mac built-in Apache server (not MAMP)
Server version: Apache/2.4.54 (Unix)
Server built: Aug 24 2022 03:08:51
Web site structure:
~Sites/test
In ~/Sites/test/php.index, I have:
echo "Hello World!";
When I do:
localhost/test
I see:
Hello World!
I want everything to go to index.php, no matter what path I enter as part of the url, so I added an ~/Sites/test/.htaccess, with the following in it:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php[L]
When I do:
localhost/test
I still see:
Hello World!
But if I do:
localhost/test/foo
I get:
**Not Found**
The requested URL was not found on this server.
I am following a tutorial, and the .htaccess file is supposed to take me to the index.php file, no matter what path I include in my url.
Any ideas?