Пытаюсь перенести проект PHP с apache на lighttpd. У меня есть следующая перезапись в apache:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule !\.(js|ico|gif|jpg|jpeg|png|css|ttf)$ /index.php?_url=/$1 [QSA,L]
Мне не удается перевести его в lighttpd mod_rewrite.
Вот некоторые из моих попыток:
url.rewrite-if-not-file = (
# try with two separate matches - when the request ends with file.ext
"\.(?!(js|ico|gif|jpg|jpeg|png|css|ttf))[\?]{0,1}(.*)$" => "/index.php?_url=/$1",
# if the request ends with /
"/[\?]{0,1}$" => "/index.php?_url=/"
# ".+/(.*)?(.*)" => "/index.php?_url=/$1",
# "((?!\.(js|ico|gif|jpg|jpeg|png|css|ttf)).*)" => "/index.php?_url=/$1"
# "^([^\?(js|ico|gif|jpg|jpeg|png|css|ttf)]+)[\?]{0,1}(.*)$" => "/index.php?_url=$1&$2"
)
С последней версией единственное отличие Я вижу единственное различие в $ _SERVER ['SCRIPT_NAME'] PHP. Это: [SCRIPT_NAME] => / v1 / en / entity / method / # с apache [SCRIPT_NAME] => /index.php # с lighttpd
Сам запрос: https://api.local/v1/en/entity/method/