# How to block access to the site directory through the browser?

**URL:** <https://community.modx.com/t/how-to-block-access-to-the-site-directory-through-the-browser/4891>\
**Category:** Support\
**Tags:** settings, modx\
**Created:** [January 24, 2022, 11:08am UTC](https://community.modx.com/t/how-to-block-access-to-the-site-directory-through-the-browser/4891 "2022-01-24T11:08:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexandrZalamay](https://community.modx.com/user_avatar/community.modx.com/alexandrzalamay/32/1136_2.png) [@AlexandrZalamay](https://community.modx.com/u/AlexandrZalamay)\
**Post date:** [January 24, 2022, 11:08am UTC](https://community.modx.com/t/how-to-block-access-to-the-site-directory-through-the-browser/4891/1 "2022-01-24T11:08:56Z")

</div>

Good afternoon, how to close the root of the project from sharing through the browser?

 ![изображение](https://modx-community.s3.dualstack.us-east-1.amazonaws.com/original/2X/5/55afc47d213c3dfb3df316ca7e4d0744f9a3fd7f.png)

How to make a message about unavailability when trying to go to the root of the site through a browser, like here, and how to do it with modx tools?

 ![изображение](https://modx-community.s3.dualstack.us-east-1.amazonaws.com/original/2X/4/4be9dfef9ae377a93be63ee896da00d246605e0e.png)

---

<div class="post-metadata">

**Author:** ![halftrainedharry](https://community.modx.com/user_avatar/community.modx.com/halftrainedharry/32/1063_2.png) [@halftrainedharry](https://community.modx.com/u/halftrainedharry)\
**Post date:** [January 24, 2022, 11:25am UTC](https://community.modx.com/t/how-to-block-access-to-the-site-directory-through-the-browser/4891/2 "2022-01-24T11:25:43Z")

</div>

If you don’t want the files to be listed in the `/assets` directory, you could add a `.htaccess` file to the directory with the content:

```auto
Options -Indexes

```

---

<div class="post-metadata">

**Author:** ![AlexandrZalamay](https://community.modx.com/user_avatar/community.modx.com/alexandrzalamay/32/1136_2.png) [@AlexandrZalamay](https://community.modx.com/u/AlexandrZalamay)\
**Post date:** [January 24, 2022, 12:12pm UTC](https://community.modx.com/t/how-to-block-access-to-the-site-directory-through-the-browser/4891/3 "2022-01-24T12:12:07Z")

</div>

its true, thank very much

---

<div class="post-metadata">

**Author:** ![system](https://community.modx.com/user_avatar/community.modx.com/system/32/2_2.png) [@system](https://community.modx.com/u/system)\
**Post date:** [January 26, 2022, 12:13pm UTC](https://community.modx.com/t/how-to-block-access-to-the-site-directory-through-the-browser/4891/4 "2022-01-26T12:13:03Z")

</div>

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.
