Password Protect Parts or All of Your Website

Adding protected areas to HTML websites

Sticky Note Password Protection
Support to add password protection to webpages and folders on your website. In most cases you will place the protected files inside a folder and then setup the protection using one of the methods listed below.

See Instead…

Option #1: Protect one page
Javascript - not secure: Javascript is the easiest way to password protect a single page on your website but is not considered very secure. You can use a rel="nofollow" meta tag to hide the protected page from search engines.

Option #2: Protecting one area
Javascript - not secure: Protect a single page or group of pages. Search engines may still be able to find your protected pages so this is not 100% secure. The following website offers a login application with setup directions.

Option #3: Protecting a directory
Server side - secure: In most cases, you can password protect an entire directory (folder) on your hosting server. This is a very secure setup and you can add a login with a password (or multiple logins). Follow these steps.

Note: Use caution when password protecting folders in your hosting account and be sure to test after any changes. Double check what folder you are protecting before applying any changes.

  1. Create a folder inside your main website or template folder on your computer hard drive off-line. This will be your protected folder.
  2. Place or create HTML webpages inside this folder. The homepage for inside the folder can optionally be named "index.html".
  3. Since you are placing webpages inside a folder, you'll need to either copy an entire template into the folder, or set paths so the HTML pages in the folder will work properly. See the following:

  4. Use FTP software to upload your off-line folder onto your web hosting server.
  5. Once uploaded, protect the directory (folder) in your hosting login. If you have Allwebco or cPanel hosting: login to cPanel, go to "Directory Privacy" under "Files". Follow the directions on the page to protect the folder.
    cPanel Files
    If you do not have cPanel hosting: Check in your control panel for folder protection help, or contact your hosting company support.

Related Topics:
Placing webpages inside folders
Simple Javascript Password Protection

Related Links:
Gatekeeper login Javascript