Lighttpd and sub directories
I have URL like :
http://example.com/dir1/...
http://example.com/dir2/...
http://example.com/dir3/...
and I would like to retrieve the dir1, dir2, dir3... (they are not real directories) in a DIR_NUMBER environment variable :
$HTTP["host"] == "example.com" {
$HTTP["url"] =~ "^/(.*)/" {
setenv.add-environment = ( "DIR_NUMBER" => $1)
url.rewri开发者_如何转开发te-once = (
"^/(.*)" => "/index.php/$1"
)
}
It does not work, any idea ? Is it possible ?
Thanks.
You need to use url.redirect
instead of url.rewrite-once
if it's not a real file which the webserver is trying to access.
精彩评论