Hi 2 questions regarding this:
1) I am trying it with a <virtualHost> in my httpd.conf -> I put the <Location "/admin"> inside my <virtualHost> directive (At the bottom) but when I go to anything with www.example.com/admin I get a 401.shtml error served by Cake. This is a server-authentication apache error. I have a htpasswd file setup and a single user added to it. So I think the problem is with <VirtualHost> but I read on several Django sites that one can nest the <Location > directive within the <virtualHost> one. 2) Is there a way that you can specify the <Location> set of instructions within an .htaccess file of Cake? If so, which one to make the /admin protected? the document root? Or the webroot? Any ideas? thanks for the tip anyway - I tried ti on a non-virtualhost setup and worked a charm Luke On Jan 2, 9:02 pm, Mazgalici <[EMAIL PROTECTED]> wrote: > Thanks adica Multumesc :D > > On 26 Noi 2007, 21:39, Dragos Chiriac <[EMAIL PROTECTED]> wrote: > > > > > Mazgalici wrote: > > > Does anybody know how to put a passoword on .htaccessfile for a > > > direcory for examplehttp://localhost/admin? > > > > Thanks > > > Hi, though it seems a stupid question it is not, and you'll see why : > > > Part one, preety straight forward : > > > Put a .htaccessin the dir you want to protect > > > AuthUserFile /my/passwd/file > > AuthName "Title" > > AuthType Basic > > Require valid-user > > > /my/passwd/file is created with the following command : > > htpasswd -c /my/passwd/file bob > > > PS: Does not really have much to do with cake. > > > Part 2 > > > /admin(as cake uses rewrites) is not actually a directory. So then you have > > a problem :) > > Solvable though , putting in the docroot ahtaccesswith something like : > > > <Location "/admin"> > > AuthType Basic > > AuthName "Title" > > AuthUserFile /my/passwd/file > > Require valid-user > > </Location> > > > Of course if you need to match a regexp : > > > <LocationMatch "/mysecret/[^/]+/"> > > AuthType Basic > > AuthName "Title" > > AuthUserFile /my/passwd/file > > Require valid-user > > </LocationMatch> > > > Hopefully it works, most is from memory, I think I installed to many TRACs > > lately. > > > This part have something tangential with cake anyway. > > > And if we are so offtopic, in my language Mazgalici means "the ones that > > smears/scribbles" :). > > > Kind regards, > > D --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
