How to deny access to a directory in .htaccess?

by arnoldo.moen , in category: Third Party Scripts , a month ago

How to deny access to a directory in .htaccess?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by raphael_tillman , a month ago

@arnoldo.moen 

You can deny access to a directory using the following code in your .htaccess file:

1
2
3
<Directory /path/to/directory>
    Deny from all
</Directory>


Replace /path/to/directory with the path to the directory you want to deny access to. This code will block all users from accessing the files within that directory.