在我的lighttpd
配置文件中,我有一个这样的重写规则:
$HTTP["host"] == "sub.example.com" {
url.rewrite = (
"^/(.*)" => "/sub/$1"
)
}
因此,当用户访问时http://sub.example.com
,她实际上是在访问http://example.com/sub
。
问题是这PATH_INFO
似乎是错误的,
URL: http://sub.example.com/extra
PATH_INFO:
expected: /extra
what I get: /sub/extra
现在每当我打电话时request.get_path()
,它都会返回类似的东西 http://sub.example.com/sub/extra
,这不是我想要的。
当然,我可以直接重写类的get_path
方法request
,但是我想知道是否有更简单的方法,比如改变 lighttpd 配置?