I have a php script that relies on the following rewrite rules:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/script.*$ [NC]
RewriteRule (.*)$ script.php/go [QSA,L]

So when someone visits http://example.com/foo, the script is called script.php/foo. This should be publicly visible.

When I visit http://example.com/script.php/adminstuff/ I'd like to use http basic authentication. (I know how to use this in the basic case.) How will this react with the rewrite rules above?

Thanks.

link|improve this question
feedback

1 Answer

up vote 0 down vote accepted

You couold use <Location> tag:

<Location http://example.com/script.php/adminstuff/>
      AuthType xxxx
      ...
</Location>
link|improve this answer
Is there something analogous that can be used in an .htaccess file? If not I can use this recipe, but I'd prefer to have it in .htaccess. Thanks. – bstpierre Dec 21 '09 at 13:24
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.