Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.
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 127.0.0.1] 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

1 Answer 1

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

 
discard

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.