1

htaccess:

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?

1 Answer 1

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.

2
  • 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, 2010 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, 2010 at 14:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .