Tuesday, October 26, 2010

lighttpd, url rewrite, plugins, and you

I attempted to login to do *some* kind of editing on the 1.3 book for
urls with lighttpd rewrites. i can log into Bakery just fine, but not
the book.

But that's not why I'm here. I did some basic searching through the
groups here to see if this had already been covered, but didn't find
anything.

I spent some time today trying to diagnose why my installation of
DebugKit was failing with css and js assets. Specifically, placing
debugkit into one of my controllers did "The Correct Thing' right up
until it tried to load the js and subsequent css.

The culprit ultimately was the rewrite rule I borrowed from section
3.3.5: http://book.cakephp.org/view/918/Pretty-URLs-and-Lighttpd

It states:
...
"/(css|files|img|js)/(.*)" => "/$1/$2",
...
Unfortunately, this forces matching against this css request: /
debug_kit/css/debug_toolbar.css. We really only want to match against
'native' (i.e., non-plugin) css. I modified my rule such:

"^/(css|files|img|js)/(.*)" => "/$1/$2",

Now cake does the right thing with plugin assets once again.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: