Including many rewrite directives in lighttpd

I have a bunch of projects in parallel subdirectories that 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 found that I cannot just skip them because I will get a "duplicate configuration configuration" error. I see that the way I should use this looks like this:

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

However, if I create configuration files for each directory, just enable the rewrites and create them with a shell script, I cannot put any other easy directives in the directory files. Again, I'm new to the world, so maybe I don't need and just don't understand.

What is the β€œright way” for this?

+3
source share
1 answer

to try:

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

Add a new configuration to an existing variable, rather than defining it again.

+5
source

Source: https://habr.com/ru/post/1697475/


All Articles