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

Take a look at my rewrite log:

(2) init rewrite engine with requested uri /bundles/astrupsspectacle/spectacle.css
(3) applying pattern '^(.*)$' to uri '/bundles/astrupsspectacle/spectacle.css'
(4) RewriteCond: input='${REQUEST_URI}' pattern='!^/app\.php' => matched
(4) RewriteCond: input='${REQUEST_URI}' pattern='!^/bundles/' => matched
(2) rewrite '/bundles/astrupsspectacle/spectacle.css' -> '/app.php/bundles/astrupsspectacle/spectacle.css'
(2) local path result: /app.php/bundles/astrupsspectacle/spectacle.css
(2) prefixed with document_root to /srv/spectacle/web/app.php/bundles/astrupsspectacle/spectacle.css
(1) go-ahead with /srv/spectacle/web/app.php/bundles/astrupsspectacle/spectacle.css [OK]

It says pattern='!^/bundles/' => matched even though it clearly doesn't. My pattern is:

RewriteCond ${REQUEST_URI} !^/bundles/

But I have also tried:

RewriteCond ${REQUEST_URI} !^bundles/

and even:

RewriteCond ${REQUEST_URI} !^bundles

And they all say "matched". What the hell!?

share|improve this question
up vote 4 down vote accepted

You're using the wrong symbol for the environment variable. It should be % instead of $. So the condition should be

RewriteCond %{REQUEST_URI} !^/bundles/
share|improve this answer
I should add that it took me about 5 re-readings of the post to find that... – Jenny D May 29 '13 at 9:51
FINALLY!!!!!!!! – Hubro May 29 '13 at 9:58
I'm glad it worked! – Jenny D May 29 '13 at 10:02

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.