문제

I'm moving from Apache to Lighttpd and need to setup similar rewrite rules.

How would I go about having multiple folders creating URL variables? This works well in 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]

Thanks,

Mike

도움이 되었습니까?

해결책

Try:

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"
)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top