You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by KK CHN <kk...@gmail.com> on 2009/03/05 11:01:42 UTC

[users@httpd] how to do a Password protection for a RewriteRule based VirtualHost

<VirtualHost *:80>
ServerName  mydomain.com
RewriteEngine On
RewriteRule ^/(.*)
http://127.0.0.1:8081/VirtualHostBase/http/www.mydomain.com:80/site1/VirtualHostRoot/$1
[L,P]
ErrorLog /var/log/apache/mysite.com/error_log
CustomLog /var/log/apache/mysite.com/access.log combined
</VirtualHost>



Now  every one can access the site   mydomain.com


But I want to restrict this access  to    a  group of members  ..
when they type www.mydomain.com
it should   promt for a username and password  ..


I know I can do it  for  directories  but is it possible for
RewriteRule section ?  How can we do it ?


Any hints & suggestions most welcome

Thanks in advance
KK

Re: [users@httpd] how to do a Password protection for a RewriteRule based VirtualHost

Posted by Krist van Besien <kr...@gmail.com>.
On Thu, Mar 5, 2009 at 11:01 AM, KK CHN <kk...@gmail.com> wrote:

> I know I can do it  for  directories  but is it possible for   RewriteRule
> section ?  How can we do it ?

You can apply authentication to any URL using  <Location> sections,
and you can apply restrictions to proxying using <proxy> sections.
It's all in the manuals.

Krist

-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org