P粉1517201732023-09-06 08:47:09
In your code, REQUEST_FILENAME requires a file with a php extension to perform the rewrite.
Try this:
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ .php [NC,L]
P粉0098287882023-09-06 00:02:49
If this is your complete configuration, your .htaccess
file will not be processed.
You have not enabled .htaccess
overrides for a specific directory. (That is, you have not enabled parsing of .htaccess
files.) By default, .htaccess
overrides are disabled.
But you didn't enable access to this area of the file system either? Have you done this elsewhere in the server configuration? !
You should have a related
section inside the
container like this:
<Directory /var/www/repos/pcts> # Enable .htaccess overrides AllowOverride All # Allow user access to this directory Require all granted </Directory>
If desired, you can further restrict the .htaccess
overrides (see reference link below)
refer to: