httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hay Bruce" <>
Subject [users@httpd] RewriteRule from within directory with authentication
Date Thu, 10 Oct 2002 10:51:39 GMT

I have a single page (perl CGI script) within an authenticated area which has been 
upgraded to some Java code running on another server. I have tried to make this 
transparent to the user so that accessing the new page generates the same
authentication challenge and shows the old URL in the browser. The snippet of
httpd.conf looks like this:

  <Directory /home/hbr/myauthor/swx/author/html/members/protected>
    AuthType            Basic
    AuthName            "Member Section"
    AuthUserFile        /home/swx/admin/passwrd/member.pwd
    require             valid-user
    RewriteEngine       on
    RewriteRule         /members/protected/cgi/ http://localhost:52848/swx/members/only/system_status.html
    ErrorDocument 401           /error/msc_401.html
    ErrorDocument 403           /error/msc_403.html
    ErrorDocument 404           /error/msc_404.html

However the rewrite seems to be ignored within the <Directory/> context and
I arrive at the old page.

If I put the RewriteRule in the <VirtualHost /> context it works correctly
but with no authentication challenge :-( I guess it hands the request off
to mod_proxy before determining that the original file was within an
authenticated directory.

Is there some magic incantation of the RewriteRule which will make it work
after the authentication phase?



The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message