tags:

views:

297

answers:

1

I have a bunch of projects in parallel subdirectories that all have etc/lighttpd.conf files. The files are very simple; they just include a directive that looks like this:

url.rewrite-once = ("^/project(.*)$"=>"project/router.php?args=$1")

Unfortunately, I just discovered that I can't simply loop through them, because I'll get a "duplicate config variable" error. I see that the way I'm supposed to use it is like this:

url.rewrite-once = (
    "^/project1(.*)$"=>"project1/router.php?args=$1"
    ,"^/project2(.*)$"=>"project2/router.php?args=$1"
)

However, if I make my per-directory config files just include the rewrites, and have a shell script build them, I can't really put any OTHER lighty directives in the per-directory files. Then again, I'm new to lighty, so maybe I don't need to and just don't realize it.

What's "the right way" to do this?

+1  A: 

try:

url.rewrite-once += ("^/project1(.*)$"=>"project1/router.php?args=$1")

to append your new config to the existing variable instead of defining it again.

pjz
That worked like a charm... I should have RTFM! Thank you!
Max