HTML Basix - HTML tutorials and online webmaster tools

Htaccess code generators Code generators Tutorials

Subscribe to RSS feed
Subscribe to the HTML Basix RSS feed.

Password Protection Code Generator

Password protect folders using htaccess. Users will need to enter their username and password to gain access to the folder.
  • Enter your username
  • Enter your password
  • Enter the full server path to where the htpasswd file will be stored. This is best if it can be stored 'outside' web-accessed areas, such as in a folder alongside your public_html file (or something similar). If this is not possible, then either another folder or the same folder. We just need the full path to where it is!
  • Enter the message you wish to have displayed on the windows box which pops up.
  • Copy the first piece of code and paste it into notepad and save it as htaccess.txt. Upload it in ASCII format to the folder you wish to protect and rename it to .htaccess (remember the dot!!)
  • Copy the second piece of code and paste it into notepad and save it as htpasswd.txt. Upload it in ASCII format to the folder you stated in the path (or the same folder as the .htaccess file) and rename it to .htpasswd (remember the dot!!)
  • Unless you have your ftp program set to show invisible files, the file will then disappear from sight. Don't worry, it's still there!
  • If you have an existing htaccess file, copy and paste the generated code into that.

username and password details
path to password file:
server path, NOT url.
message for popup:


Page will open in a new window

Site Stats     
Total: 9,752,255 Total: 28,288,622
Today: 123 Today: 596
Yesterday: 315 Yesterday: 833
Past Month: 9,765 Past Month: 25,823

336 visitors in the last 24 hours
This page has been visited 224,519 times
There is currently 1 visitor online
click to see where
most people online at once:
286 visitors on 06/27/2012
   You beaut

This site is © HTML Basix 2003 - 2009