Get wrong PATH_INFO after rewriting in lighttpd
- by Satoru.Logic
In my lighttpd config file, I have a rewrite rule like this:
$HTTP["host"] == "sub.example.com" {
url.rewrite = (
"^/(.*)" => "/sub/$1"
)
}
So when a user visits http://sub.example.com, she's actually visiting http://example.com/sub.
The problem is that the PATH_INFO seems wrong,
URL: http://sub.example.com/extra
PATH_INFO:
expected: /extra
what I get: /sub/extra
Now whenever I call request.get_path(), it returns something like http://sub.example.com/sub/extra, which is not what I want.
Of course, I can just override the get_path method of the request class, but I wonder if there is a simpler way like changing the lighttpd config?