3
I have a . htaccess in my development environment.
Now I need to release a directory of the site, actually a specific PHP file.
I’m using this code on. 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>
Mano what simplicity, I researched but found other more complex solutions that I did not need, but what I needed was exactly this here. Simple. Ours because I didn’t think of it before rsrsrsr
– Michael Alves
I have a question about this: If we happen to have several directories and subdirectories and in some of them there are files with this name meuFicheiro.php, but I just want to free access to the file meuFicheiro.php that is at the root leaving the others blocked for access? How to do?
– Carlos Rocha
@Carlosrocha In that case, there would have to be one
.HTACCESS
in folders to block access. At root it would not be necessary to have the lock since that file is to be accessible.– Zuul
@Carlosrocha Anyway, this "design" of the organization is not the most functional given force to much more work. Ideal would be a folder with the authorized files and another one with files subject to lock.
– Zuul
Check it out: Rewritecond %{REQUEST_URI} ! /|manutencao.php$ [NC] Rewriterule . * index.php. This frees up any page named maintainance.php in all folders and subfolders of the system. Right? What I need is to release only the one at the root leaving blocked the others!
– Carlos Rocha