.htaccess password protecting folders.

nathanc

Well-Known Member
#1
Hi,
I have a rails site running on 3.2.4 Enterprise.
I am trying to protect a sub folder under public called "protected"
http://easybutton.us/protected/test.html

Server settings for htaccess
Allow Override: X Auth
Access File Name .htaccess

I understand the htaccess chain of command "Server > Vhost > context"

Vhost template and rails context settings for htaccess are not set. This is suppose to default back to the server settings I have above.

This is my .htaccess file

AuthName "Name of Password Protected Area"
AuthType Basic
AuthUserFile /PATH/TO/.htpasswd
Require valid-user

For some reason its not asking for a password.
Any suggestions?
 
Last edited:

mistwang

LiteSpeed Staff
#2
You can try it on test server with debug logging if you can. If the .htaccess file was loaded, it should show in the error.log.
And make sure to clear you browser cache in case the page was cached.
 

nathanc

Well-Known Member
#3
I figured out the issue.
These settings have to be set for Server, Vhost and context explictly.
"
Allow Override: X Auth
Access File Name .htaccess
"
chain of command seems to be broken.
I have tested on 3 servers.
 
Top