Re: [Cppcms-users] Some remarks
Brought to you by:
artyom-beilis
|
From: Artyom <art...@ya...> - 2009-11-21 16:29:51
|
> I must add that the problem is not in the configuration but
> in the
> regex in the url.add method.
> If the regex is url.add("(.*)",
> boost::bind<void>(&myapp::index,this,_1));
> it works. However, when I try to display the binded
> argument it is an
> empty string.
The basic rule. When server matches url it splits it into
"SCRIPT_NAME" and "PATH_INFO"
Under lighttpd:
For script "/foo":
/foo/bar => "/foo" and "/bar"
/foo/ => "/foo" and "/"
/foo => "/foo" and ""
For script "my_app.fcgi" it would be
/some/path/my_app.fcgi/bar => "/some/path/my_app.fcgi" and "/bar"
/my_app.fcgi => "/my_app.fcgi" and ""
As far as I know for script "/" it does wired things... do not
use it directly. Rather rewrite the URL to something like
/bar => /foo/bar
And use script "/foo"
url.add ALWAYS matches against PATH_INFO.
So in order to make url parsing work, make sure you get from the
server the correct path info.
For simplest debugging:
url.add("^(.*)$",boost::bind(&myapp::index,this,_1));
Make sure you make the server sending correct PATH_INFO
variable.
Best,
Artyom
|