.htaccess on apache2 on mac ventura struggles with rewrite

50 views Asked by At

I've got a htaccess with the following:

# Turn mod_rewrite on
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d


RewriteRule ^([a-zA-Z0-9]+)/?$ display.php?username=$1

If given

'http://localhost/example/blue' 

then on the webpage must show the username 'blue' using php code however mac fails and instead it says

404 not found. 

The server runs on

/usr/local/var/www/example

directory and not the

'/Library/...' 

directory.

I've enabled

mod_rewrite,

i've changed to

AllowOverride All. 

I installed and set up

php 8.3.0
0

There are 0 answers