.htaccess not working for password


#1

I did everything correctly but its not working…
AuthType Basic
AuthName "Password Protected Area"
AuthUserFile /home/ubuntu/workspace/untitled folder/KSceduals/.htpasswd
<Files “KScedual.html”>
Require valid-user


#2

Not exactly sure what’s going on with your setup but I followed these instructions on a new PHP + Apache workspace and was able to get it working. Here’s my workspace with it working if you’re curious.


#3

I used that website too.
This is mine


#4

Where is your .htaccess file?


#5

Click on the gearwheel in the top-right of the files panel and choose to show hidden files.

At first mine wasn’t working because I had misspelled htaccess as .htacces so that messed me up. Look over your files for misspellings or other similar errors. Looks like it’s a pretty short process so you could also try just going through the process again and see if you fix it on your second try.


#6

Could it have something to do with the space in untitled folder?
Yesterday When i accessed your website and previewed index it asked for username and password. I’d assume that is the .htaccess’s doing. However today I tried again and I got to the url without a password or username so that bring up the question, Why was your .htaccess working yesterday but not working today? Maybe you should give it a go. Did you change anything yesterday night?


#7

I stopped the workspace and restarted apache, which made it so htaccess was no longer applied. In other words, I chose to no longer password protect it.

As you mentioned, the space is indeed causing your issues. Google for “Linux spaces in directory name” and that should provide some helpful info for you to get this up and running :ok_hand:


#8

Hey I seem to have tried everything. I’m honestly getting pissed. If there is any possibility that you could maybe do it for me? I know that’s asking a lot but if you could that would be great to find out what I’m doing wrong. I gave you access to edit it.


#9

This Stack Overflow thread mentions not using the standard Linux behavior for space in a filename. Try removing the space from the directory name and testing it that way. That’ll help narrow down what the issue is :slight_smile:


#10

wait how do you start the workspace and start apache, maybe thats the problem


#11

I have been able to get the for to appear for the username and password however I can’t get logged in with the username:password I set in .htpasswd.

Have you been able to get the form to appear to enter the username and password?


#12

Hi All,

I wrote a gist few months ago about basic auth on Cloud9.

I hope can help you. I am using basic auth in all my workspaces.

Thanks,
Lelle