apache – How to release access to specific FOLDER or FILE using .htaccess?


I have a .htaccess in my development environment.

Now I need to free up a site directory, actually a specific PHP file.

I'm using this code in .htaccess, I'm releasing several extensions, if I release the PHP extension, it accesses the file, but I don't want all PHP files to be released, I would like a specific one to be released.

order deny,allow
deny from all
<files ~ ".(xml|css|jpe?g|png|gif|js|otf|woff|svg)$">
allow from all


Block access to .PHP files:

<Files *.php> 
    deny from all

Authorize a specific file:

<Files "meuFicheiro.php">
    Order Allow,Deny
    Allow from all
Scroll to Top