.htaccess 400 bad request

.htaccessapache-2.2mod-rewrite

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?

Best Answer

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.

Related Topic