Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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, the script is called script.php/foo. This should be publicly visible.

When I visit 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?


share|improve this question
up vote 0 down vote accepted

You couold use <Location> tag:

      AuthType xxxx
share|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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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