# Protecting whole page with .htpasswd

**URL:** <https://forum.infinityfree.com/t/protecting-whole-page-with-htpasswd/28741>\
**Category:** Hosting Support\
**Created:** [April 21, 2020, 2:02pm UTC](https://forum.infinityfree.com/t/protecting-whole-page-with-htpasswd/28741 "2020-04-21T14:02:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacob-An](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/jacob-an/32/720_2.png) [@Jacob-An](https://forum.infinityfree.com/u/Jacob-An)\
**Post date:** [April 21, 2020, 2:02pm UTC](https://forum.infinityfree.com/t/protecting-whole-page-with-htpasswd/28741/1 "2020-04-21T14:02:34Z")

</div>

Hi,  
I’m trying to secure my whole page with .htpasswd file. It’s just:  
admin:(password here)

Custom .htacces file:  
AuthUserFile /home/volX\_X/epizy.com/epiz\_XXXXXXXX/XXX.epizy.com/htdocs/.htpasswd  
AuthType Basic  
require valid-user  
AuthName “Private Website”

Everytime I’m getting just 500 error page. In CPanel there’s option to secure specific subfolders but I don’t want to do this. I want to secure the whole website. Is it possible with free hosting?

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [April 21, 2020, 5:11pm UTC](https://forum.infinityfree.com/t/protecting-whole-page-with-htpasswd/28741/2 "2020-04-21T17:11:35Z")

</div>

If you type `/` in the subfolder box, you protect the entire website. If that doesn’t work, you can use our tool to generate the config files and then move the files.

The .htaccess and .htpasswd files have a quite specific structure and content requirements. Having a tool generate the config for you is highly recommended over trying to build it yourself.

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [June 20, 2020, 5:11pm UTC](https://forum.infinityfree.com/t/protecting-whole-page-with-htpasswd/28741/3 "2020-06-20T17:11:40Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
