How to set password to a folder?


#1

hello. how can I set a password to some folder on website?
I tried this but it not works(it’s about .htaccess .htpasswd):

maybe because of wordpress installed to the site?


#2

The dreamhost doc for doing it manually is http://wiki.dreamhost.com/Htaccess

You can also configure it in the dreamhost panel. See goodies -> htaccess /WebDAV

It will work just fine with Wordpress installed the same place


#3

it’s same thing. when I place the .htaccess into directory then it just drops me to "Sorry, Can’t find that Game. " page on wordpress. maybe it’s all because of wordpress.
I’ll try the goodies -> htaccess /WebDAV

OK. Tried it.
Same happens with password configuration with goodies -> htaccess /WebDAV actually it created just same .htaccess files that I did manually. So it’s not possible because of wordpress?

Maybe I not understand how to access the password protected directory? But in tutorials it shows that it will create a pop-up form with login/password input.

thanks

P.S.
Tried it on the other site that does not have a wordpress and it does worked there. So it’s because of wordpress.


#4

visit http://mywptest.happysandwich.com and you will get a popup asking for credentials that looks like this: http://imgur.com/qb21tad

It’s possible you have a wordpress plugin installed that interferes, but wordpress itself does not. (mywptest above is in fact just a WP install I keep around for trying things).

This type of login really isn’t secure. It’s most often used for dev or test sites where you might not want people just clicking around. It also keeps search bots (like google bot) from indexing, which might be important if you have not quite yet ready for public display stuff, or in the case of a copied site for DEV then your search rankings don’t get penalized for duplicate content on multiple sites.

AuthName "Test Site"
AuthUserFile /home/USERNAME/.htpasswd
AuthType basic
Require valid-user
Order deny,allow
Deny from all
Allow from XXX.XXX.XXX.XXX
Satisfy Any

I changed the USERNAME for this example, It would be the username you log into ftp with. this is set so that .htpasswd actually resides in the users home directory. Whereas the actually .htaccess is located at /home/USERNAME/mywptest.happysandwich.com/.htaccess

This also has an IP exception built in. I can replace the XXX.XXX.XXX.XXX with an acctual IP (for example my local connection’s external IP) and then that IP does not have to use a password, it simply gets free access.