Lighttpd 和子目录
我有这样的 URL:
http://example.com/dir1/...
http://example.com/dir2/...
http://example.com/dir3/...
并且我想检索 dir1、dir2、dir3...(它们不是真正的目录) DIR_NUMBER 环境变量:
$HTTP["host"] == "example.com" {
$HTTP["url"] =~ "^/(.*)/" {
setenv.add-environment = ( "DIR_NUMBER" => $1)
url.rewrite-once = (
"^/(.*)" => "/index.php/$1"
)
}
它不起作用,有什么想法吗?是否可以 ?
谢谢。
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.rewrite-once = (
"^/(.*)" => "/index.php/$1"
)
}
It does not work, any idea ? Is it possible ?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果网络服务器尝试访问的不是真实文件,则需要使用 url.redirect 而不是 url.rewrite-once。
You need to use
url.redirect
instead ofurl.rewrite-once
if it's not a real file which the webserver is trying to access.