Question

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

Was it helpful?

Solution

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"
)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top