Call us today 253-891-9648 or Toll-Free: (866) 932-9778
Follow Notable Web on Facebook

Support Topics

Contact Information


Local:(253) 891-9648
Toll Free: (866) 932-9778

Fax:Contact Notable Web Today
    (253) 891-9412

Mailing Address:
    P.O. Box 7762
    Bonney Lake, WA

NOTABLE WEB - Support Center

Support Home Page » cPanel Administration » How to Password Protect one file

How to Password Protect one file

1) Put your .htpasswd above your root so visitors can't access it

2) Put the username and encrypted password inside the .htpasswd file.


To create the encrypted password, use an online utility, such as

It doesn't matter how many files under how many directories you wanted to protect, they can share a common .htpasswd file.

3) Place the following code in your .htaccess file, in the same folder where you want to protect the file. (Be sure to replace cpanelusername with your actual cPanel username. Replace test with the path to your file. Replace file.html with your file's actual name.)


<FilesMatch "file.html">
AuthName "Member Only"
AuthType Basic
AuthUserFile /home/cpanelusername/.htpasswd
require valid-user

/home/cpanelusername/public_html/test/file.html is protected
/home/cpanelusername/public_html/test/index.html and all others are NOT protected

You can protect more than one file by using wildcard names. On the FilesMatch line, follow one of these examples:

<FilesMatch "*.html">
<FilesMatch "file.*">
<FilesMatch "*.*">

Web Site Hosting

Web Site HostingWe know exactly what it takes to make a business successful on the Internet.

Our web hosting plans are very diverse and designed for almost any type of website or e-commerce solution. Notable Web has combined the best hardware, latest software and the ...
Read More!

Web Site Design

Website DesignThe team at Notable Web strives to create websites that are easy to navigate by both human visitors and by various search engine spiders. The clean slicing and coding we use provides the fastest possible page loads. Our websites are extremely versatile and allow maximum flexability for updates. ..
Read More!

Domain Name Registration

Domain Name RegistrationA domain name is the alias that identifies a certain organizations' presence on the Internet. For example, Microsoft uses the Internet address

The choice, which you make for your personal or business domain name ...
Read More!

Notable Web Incorporated © 1996 - 2018. All Rights Reserved.