Deny access to one specific folder in .htaccess Ask Question

Deny access to one specific folder in .htaccess Ask Question

I'm trying to deny users from accessing the site/includes folder by manipulating the URL.

I don't know if I have to deny everything and manually make individual exceptions to allow, if I can just deny this one folder, or if there's a rewrite function that can be used.

Specific example: I don't want to see the directory files by typing in localhost/site/includes into the URL.

ベストアンサー1

Create site/includes/.htaccess file and add this line:

Deny from all

おすすめ記事