0

I'd like to configure Lighttpd 1.4.35 with a second document-root-path. Lighty should look up a file via the first server.document-root-path given in the config-file. If it can't find the file it should look it up via the second server.document-root-path.

I couldn't find any hint nor config to instruct Lighty that way.

Does anyone have any hint for me? Is this even possible? Anything I could find with google is about vhosts and aliases and so on.

Thanks!

lshw
  • 35
  • 1
  • 5

2 Answers2

0

A workaround is to use a subdomain or 2 different domains or a simple bash-script and load 2 different config files.

Micromega
  • 12,486
  • 7
  • 35
  • 72
0

You have two options, avoiding CGI/Perl/bash or similar:

a) Use mod_magnet, a little LUA script can do the "file exists" with lighty.stat() and if not, handle other path/to/file. The bytecode for LUA scripts is cached in lighttpd and is not a problem for high traffic if your script doesn't do anything pretty intensive. Check this example: https://xenforo.com/community/threads/lighttpd-url-rewrite-with-mod_magnet.48055/

b) Use "url.rewrite-if-not-file", as shown here: https://www.drupal.org/node/719508

Juanga Covas
  • 315
  • 2
  • 5