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

3

I have a .htaccess in my development environment.

Now I need to release a directory from the site, actually a specific PHP file.

I am using this code in .htaccess, I am releasing several extensions, if I release the PHP extension, it accesses the file, but I do not 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
</files>
    
asked by anonymous 06.04.2015 / 17:38

1 answer

0

Block access to .PHP files:

<Files *.php> 
    deny from all
</Files>

Authorize a specific file:

<Files "meuFicheiro.php">
    Order Allow,Deny
    Allow from all
</Files>
    
06.04.2015 / 18:05