Web Hosting Geeks | Web Hosting Experts
Need help? Call us 1(866)TOP-HOST

14625 reviews 1734 hosting providers

Questions & Answers

how can I password protect a directory in wordpress?

Apr 6, 2012 by rooby
hi there

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

thanks

1 Answer

0 votes
Apr 6, 2012 by lionhost
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