password protection for RewriteRule

dhaneshk k dhaneshkk at
Thu Mar 5 02:32:34 PST 2009


I am using apache2.2    

I need to do a   password protected access to    a website   eg

I have  this  Vhost configuration in   my  httpd-Vhost.conf    

<VirtualHost *:80>
RewriteEngine On
RewriteRule ^/(.*)$1 [L,P]
ErrorLog /var/log/apache/
CustomLog /var/log/apache/ combined
</VirtualHost>Now anybody   in their  browse  type  they  can view my site , but I want to     make them to enter a username  & password  to view the site .

How can  I do a    password protected   access to my site  for this  RewriteRule  based Vhost 

( I know that I can do   .htaccess & .htpasswd   based authentication for   directories in  apache . )

But for RewriteRule   is it possible ?  How ?

I appreciate  very much for your valuable  suggestions & hints  to how to do that .

Thanks in advance 

So many new options, so little time. Windows Live Messenger.

More information about the freebsd-questions mailing list