Release subdirectory through .htaccess [duplicate]

2

How do I release a specific sub directory (and all of its files) via .htaccess?

As I use "friendly url" and through .htaccess I block everything that is not convenient, I would like to know how to "free" access to a specific folder and all the files in it.

OBS: the <Directory /path/to/dir/protected/unprotected> Satisfy An </Directory> command did not solve my problem, because it should be placed in httpd.conf and I do not have access to it. In the question quoted as "answered" the author probably has this access, and being this way, my doubt is not answered yet. I'll do another test.

Test result: In local tests on the file httpd.conf answer of the question flagged as answered works perfectly, but if it is placed in a .htaccess error is returned

  

Internal Server Error

For my problem I do not have access to the file httpd.conf and it must be done in the .htaccess file. So the question of how to release a specific directory via .htaccess .

    
asked by anonymous 22.05.2015 / 04:11

1 answer

2

Imagining the following structure:

public_html/
├── pasta_x/
├── pasta_y/
└── pasta_z/

Let's use as an example that you want the pasta_y folder to be publicly accessed, so the following code will be added to your .htaccess: EDIT: If Options +Indexes is enabled on your virtualHost.

<Directory “caminho/absoluto/pasta_y/”>
    #para Apache 2.2
    Order Allow, Deny
    Allow From All

    #para Apache 2.4
    Require all granted
</Directory>

If the code above does not work, you can create a .htaccess file within the pasta_y directory with the following content:

#para Apache 2.2
Order Allow, Deny
Allow From All

#para Apache 2.4
Require all granted
    
22.05.2015 / 16:32