I wanted to password protect a directory on my web site. I know the general process, but apparently, the account with the hosting I have doesn’t have telnet access (at least with the package I pay for). Is there a way for me to locally create a .htpasswd file to upload to the website that would work? I have a Mac, so I tried going to terminal, using the the htpasswd command to create a .htpasswd file, but when I uploaded it to my server, the user/password combination didn’t work. I didn’t double check my work, but I’m just assuming that different servers have a different way of generating the hash? Is there a way around this?
A little bit more info is needed, is this a dedicated server or a shared hosting plan?
Can you mention the hosting company?
You can create an .htaccess file using a plain text editor that doesn’t use word wrap.
MS Word or Notepad do insert special ASCII codes. The .htaccess and .htpasswd will have special characters added then and that will make the file useless.
It’s abac.com (aplus.net). I can create the .htaccess file fine. I made a text file named .htaccess with the path to the .htpasswd file (that I created using the Mac terminal), but the login-password combo didn’t work. In other words, I got the login/password screen, just the combo I assigned didn’t work. Are there different .htpasswd files created depending on whether, say, you’re using an Apache server vs something else?
Darn, the aplus.net knowledge base works only for registered users,
Log in and search for the info on the path or absolute path on where to add .htaccess and .htpasswd.
Different hosting providers will have a slightly different way to set this, specially if you have a shared hosting plan. Good help centers will have examples for the coding you need to use and you do need to check if the hosting is Linux based or Windows based.
It is important to know what hosting you have because .htaccess is for apache servers and Unix\Linux is the preferred environment for it. You need to check if the hosting plan you have is a Windows or Linux one.
Here is some information from Apache: