8

I'm making a website for a client, and I want to make a password protected directory. The problem is my account type only allows FTP, so is there any way to create the .htaccess and .htpasswd files locally on my computer so I can upload them via FTP?

UPDATE:

I made the files on the site @radius mentioned, and I uploaded and renamed them, but now I'm getting the following message:

"The server encountered an internal error or misconfiguration and was unable to complete your request"

cstack
  • 181

4 Answers4

7

.htaccess and .htpasswd files are just text file so you can create them locally then upload them
To create a file starting with '.' on windows see http://www.htaccesstools.com/htaccess-faq/
To create encrypted password for .htpasswd files you can use http://www.htaccesstools.com/htpasswd-generator/

radius
  • 9,701
2

You can also download the Apache 2.2 binaries and use htpasswd.exe or htdigest.exe to generate the .htpasswd or .htdigest files on windows.

1

The generator in the accepted answer seems to no longer be active. However, this one seems to work: https://www.askapache.com/online-tools/htpasswd-generator/

0

You can always use notepad to create .htaccess and .htpasswd, save them under "ALL FILES". You may not see it under Windows Explorer since Windows see no name but a long extension, but most FTP clients should have no problem showing the files to you and will allow you to upload accordingly.