# How to make file in my website only accessible by serverside?

**URL:** <https://forum.infinityfree.com/t/how-to-make-file-in-my-website-only-accessible-by-serverside/71531>\
**Category:** Hosting Support\
**Created:** [January 24, 2023, 2:27pm UTC](https://forum.infinityfree.com/t/how-to-make-file-in-my-website-only-accessible-by-serverside/71531 "2023-01-24T14:27:53Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Oxy](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/oxy/32/37989_2.png) [@Oxy](https://forum.infinityfree.com/u/Oxy)\
**Post date:** [January 24, 2023, 2:33pm UTC](https://forum.infinityfree.com/t/how-to-make-file-in-my-website-only-accessible-by-serverside/71531/2 "2023-01-24T14:33:58Z")

</div>

Hi  
create an .htaccess file with this content:

`Require all denied`

this will create 403

But first, you should move that JSON to some subfolder where the .htaccess file will be

because if you put it on root (.htaccess file)  
probably some basic things from your website will not work online

* * *

if you just want to hide the contents of the folders (but it will be accessible to everyone who knows the path)  
then you can use this

```auto
# Disable Directory Listings in this Directory and Subdirectories
Options -Indexes

```

and it is recommended !  
and do that by putting the .htaccess file with this content on the root

> [@How to set custom .htaccess rules](https://forum.infinityfree.com/t/49350):
>
> .htaccess rules are a powerful way to control how your website behaves. It can be used to set pretty URLs, define error pages, restrict access and more. There are plenty of guides available to teach you everything that can be done with .htaccess. This article can’t explain everything you can do with .htaccess rules, but it does explain how you can add them. Create the .htaccess file in your htdocs directory Every domain name on your account has a htdocs directory. Your first domain is attached…

---

_[View the full topic](https://forum.infinityfree.com/t/how-to-make-file-in-my-website-only-accessible-by-serverside/71531)._
