Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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"

share|improve this question

3 Answers 3

up vote 4 down vote accepted

.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/

share|improve this answer
1  
+1, or create a htaccess.txt and htpasswd.txt files, upload them, then rename them on the ftp server. –  Chris S Jun 20 '10 at 14:56
    
The website made the files alright, but when I uploaded them and went to a page in the directory, I got "The server encountered an internal error or misconfiguration and was unable to complete your request" –  cstack Jun 27 '10 at 15:23
    
What is the content of your .htaccess file ? –  radius Jun 27 '10 at 15:30
    
Okay, the tool you linked to works fine. I just entered the wrong thing into ".htpasswd File Location" ("/path/to" instead of "/path/to/.htpasswd") Thanks for the help. –  cstack Jun 27 '10 at 19:07

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.