I’m trying to password protect a directory in wordpress in my cpanel and it’s not working, wordpress keeps picking up the URLs and writing to it’s own software. How can I get around this?
Even if I put my files in /wp-content/uploads/downloads/
it’s still not recognizing them as downloadable, it forwards to a wordpress 404 error
1) create a .htaccess file in the directory you want to hide with this content:
then create a .htpasswd file with this content:
and then only user ‘admin’ with password ‘password’ should be able to access directory.
or..
2) if you just move it below than the public HTML root folder then you don’t have to worry about password protecting it – nobody can access it without direct server access
Create a
.htaccess
file in your downloads directory:Create a htpasswd file (outside your web root) like so: