2013-10-08 55 views
0

我正在从Apache转移到Lighttpd并需要设置类似的重写规则。Lighttpd重写 - 多个变量

我该如何解决多个文件夹创建URL变量的问题?这种运作良好,在阿帕奇:

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] 

感谢,

迈克

回答

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" 
)