[Catalyst] Help with static and RegEx

Mike McKay mike at vdomck.org
Wed Jun 29 10:48:19 CEST 2005


Answering my own question:

Mike McKay wrote:
> So I am trying to serve all static pages out of the root directory. 
> Should be simple, but I am having trouble. It seems that the regex 
> matches, but then the handler doesn't execute:
> 
> # match anything after the slash that is not a slash
> sub files : Regex('/*([^/]*\.(css|js|html))$') {

<snip/>

> code in the files method it never shows it. What is happening?

 From the documentation:
---
If you want to pass variable arguments at the end of a URL, you must
use regex actions keys with '^' and '$' anchors, and the arguments must
be separated with forward slashes (/) in the URL
---

So boys and girls, today Mike learned that all RegEx URL handlers need 
to start with a caret.

Cheers,
Mike




More information about the Catalyst mailing list