how can I password protect a directory in wordpress?

50 views
asked Apr 6, 2012 in General by rooby (560 points)
hi there

Can some one please tell me how can I password protect a directory in wordpress?

thanks

1 Answer

0 like 0 dislike
answered Apr 6, 2012 by lionhost (4,060 points)
You need to create one file and edit the .htaccess in the password protected directory.
Create a 401.html file in a separate directory (or in root) then the password protected directory
AUTHENTICATION REQUIRED<br />You need a username and password to access this area.
/protected-dir/.htaccess
Then edit the .htaccess file in the password protected directory. The authorization rules should already be set-up.  Above the rules add  ErrorDocument 401 /forms/401.html

hope this works
...