Re: [HTML-on-the-WEB] Htaccess and passwords
- On 10/1/07, Bas van Hoorn <sensei@...> wrote:
> Hi Gordon,Hmm Create a directory even though I dont need it
> --"As the URL directory doesnt actually exist - How can I add the password
> part, after the part where it redirects this particular "directory" - But
> other directories are not passworded ?"
> Have you tried putting a second .htaccess file in the physical directory
> that you want to protect?
> Then you'd have the .htaccess in your root, that takes care of redirection.
> If a user is redirected to the protected diretory, it encounters the second
> .htaccess that takes care of the password. As this file is encountered
> /after/ the user has been redirected, it shouldn't matter whether the "URL
> directory" really exists or not.
I'll tell you how it goes - Though i dont think it will work (as the
1st htaccess redirects it into the index.php file)... - so wouldnt
pick up the 2nd htaccess
But worth a shot...
NZ community groups - community@...
Freecycle Auckland :-
- Hi Gordon,
--"Hmm Create a directory even though I dont need it.
I'll tell you how it goes - Though i dont think it will work (as the 1st
htaccess redirects it into the index.php file)... - so wouldnt pick up the
Ah, I forgot you're redirecting to your PHP script, not to an actual
But no worries, how about the other way around?
Create your password directory, with the .htaccess password jigmarole, and
from /that/ .htaccess file redirect to your main (or any other) script.
That should work. (Of course in that case, do /not/ redirect your secure URL
from your main .htaccess!)
I like this kind of stuff :)