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?
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?
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.