Is it possible to deny access to the directory and allow access to the .htaccess file? how?

2

I'm trying to make a .htaccess for url's friendly but would like to make people not see my directories and at the same time the scripts could access the files ... is it possible to do this?

    
asked by anonymous 25.04.2014 / 19:20

1 answer

3

To not list your directories, just use this directive:

Options -Indexes

No .htaccess or directory configuration:

<Directory /www/pasta>
   Options -Indexes
</Directory>

Remember that to use in .htaccess will depend on AllowOverride in use allow.

If you want to block access to the files in this directory, you can be more radical and put a .htaccess in the folder with these conditions:

RewriteEngine on 
RewriteRule ^(.*)$ - [F] 

So the path will only serve for includes and similar.

  

In this case, a simpler path is for the template folders and includes outside the root of the site, for example "next to" httpdocs , not inside.

    
25.04.2014 / 19:25