You can password protect a folder by adding a .htaccess file with the following lines:

Sometimes, when the password protected folder is a sub-directory and, the parent folder has a .htaccess file that uses the rewrite engine, you may get a 404 Page Not Found error when you browse the protected sub-folder. WordPress users will especially notice this when they try to password protect a sub-folder. One way to solve this issue is to add 2 lines to the beginning of the protected folder’s .htaccess file. So, the final file will look like this:

This should solve the page not found errors!

Incoming search terms:

  • magento password protect directory
  • password protect directory prestashop

Tagged with:

Filed under: LinuxLinux TipsTips and Trickswordpress

Like this post? Subscribe to my RSS feed and get loads more!