views:

26

answers:

1

I am trying to use a method like this:

def authenticate
  authenticate_or_request_with_http_basic do |username, password|
  username == "user" && password == "pass"
end

When I have it on my local machine it resolves fine, but on my server it just keeps asking for the password. I saw the site http://railsforum.com/viewtopic.php?id=14592 which says to change htaccess in the public folder to: RewriteRule ^(.*)$ dispatch.fcgi [E=X-HTTP_AUTHORIZATION:%{HTTP:Authorization},QSA,L]

but that didn't work (had to change to just dispach.cgi). Here is what my htaccess looks like:

RewriteEngine On
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
A: 

add this line RewriteRule ^(.*)$ dispatch.fcgi [E=X-HTTP_AUTHORIZATION:%{HTTP:Authorization},QSA,L]

in your .htaccess at bottom ..

Oscar Navidad