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
RewriteEngine on

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule !\.(js|ico|gif|jpg|png|css)$ /index.php

    RewriteRule ^site-css/([0-9]+)/(.*)$     ../application/site/$1/design/css/$2 [L]

Which returns a 400 bad request, or at an apache level:

[Thu Jul 22 14:48:32 2010] [error] [client] Invalid URI in request GET /site-css/1/layout.css? HTTP/1.1

If I change the rule even slightly, it changes to a 404 error.

Is there any further way to debug this issue?

share|improve this question

Is there any further way to debug this issue?

Yes, enable mod_rewrite's extensive logging facilities: see the RewriteLog and RewriteLogLevel directives.

That said, on first glance, the ../ looks fishy. I would first try reworking the substitution target to an absolute path/URL, or alternatively, use a RewriteBase.

share|improve this answer
Ive put it in my apache httpdocs and now theres no error, but its not logged. That command doesn't work in terminal for me, I'm using the Macs built in webserver. – azz0r Jul 22 '10 at 14:17
You'd use apachectl configtest on OS X; but if the error's gone now, it was most likely due to a non-existing directory. – earl Jul 22 '10 at 14:48

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.