How to deny access to a directory in .htaccess?

by arnoldo.moen , in category: Third Party Scripts , 9 days ago

How to deny access to a directory in .htaccess?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by raphael_tillman , 9 days 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.