0

我正在从 Apache 迁移到 Lighttpd,需要设置类似的重写规则。

我将如何让多个文件夹创建 URL 变量?这在 Apache 中运行良好:

RewriteRule ^([A-Za-z0-9-]+)/?$ index.php?x=$1 [L]
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ index.php?x=$1&y=$2 [L]
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ index.php?x=$1&y=$2&z=$3 [L]

谢谢,

麦克风

4

1 回答 1

1

尝试:

url.rewrite-once = (
   "^/([A-Za-z0-9-]+)/?$" => "/index.php?x=$1",
   "^/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$" => "/index.php?x=$1&y=$2",
   "^/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$" => "/index.php?x=$1&y=$2&z=$3"
)
于 2013-10-08T22:33:30.920 回答