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 .htaccess file 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 .htaccess in 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 a htaccess with 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to