如何转换 RewriteCond 规则以使其在 Lighttpd 中工作?

如何转换 RewriteCond 规则以使其在 Lighttpd 中工作?

我如何转换此 Apache 重写规则以使其在 Lighttpd 上工作?这实际上是一个 .htaccess 文件,我需要将它们放在 lighttpd.conf 文件中。

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule www.(.*) web.php?url=$1
RewriteRule sitemap/(.*) mapdi.php?page=$1
RewriteRule tags_(.*)\.html$ tags.php?keywords=$1
RewriteRule ^([^-]*)-page-([^-]*)\.html$ tags.php?keywords=$1&page=$2 [L]
RewriteRule ^sitemap_([^-]*)\.html$ sitemap_web.php?page=$1 [L]
RewriteRule ^sitemap\.html$ sitemap.php$1 [L]
RewriteRule ^privacy\.html$ privacy.php$1 [L]

我转换了部分代码,但不确定如何转换:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$

.... ....

以下是我可以转换的内容:

url.rewrite-once = (

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(.*)/$

    "www.(.*)" => "web.php?url=$1",
    "sitemap/(.*)" => "mapdi.php?page=$1",
    "tags_(.*)\.html$" => "tags.php?keywords=$1",
    "^([^-]*)-page-([^-]*)\.html$" => "tags.php?keywords=$1&page=$2",
    "^sitemap_([^-]*)\.html$" => "sitemap_web.php?page=$1",
    "^sitemap\.html$" => "sitemap.php$1",
    "^privacy\.html$" => "privacy.php$1"
)

相关内容